Skip to content

Commit a0aef5a

Browse files
committed
feat: neutral status when no changes
1 parent 186aea5 commit a0aef5a

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
| `publish_npm` | Whether to publish to npm registry | No | `true` |
101101
| `publish_github_packages` | Whether to publish to GitHub Packages | No | `true` |
102102
| `skip_if_unchanged` | Skip version bump/publish if the local npm tarball matches the latest published tarball (ignoring version/gitHead) | No | `false` |
103+
| `neutral_on_no_changes` | Mark workflow as neutral (exit 78) when no changes are detected | No | `false` |
103104
| `npm_token` | NPM authentication token | No (required if `publish_npm` is true) | - |
104105
| `github_token` | GitHub token for releases and packages | Yes | - |
105106

SETUP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ permissions:
9696
### Optional Behavior
9797

9898
- `skip_if_unchanged` - When enabled, the action compares the local npm tarball with the latest published tarball (ignoring version/gitHead) and skips the release if identical. For private npm packages, provide `NPM_TOKEN` so the comparison can fetch the published tarball.
99+
- `neutral_on_no_changes` - When enabled, the action exits with code 78 (neutral/gray) if no changes are detected.
99100

100101
### Action Permissions Policy
101102

action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ inputs:
5454
description: "Skip version bump and publish if package.json and dist match the latest npm package"
5555
required: false
5656
default: "false"
57+
neutral_on_no_changes:
58+
description: "Mark workflow as neutral (exit 78) when no changes are detected"
59+
required: false
60+
default: "false"
5761
npm_token:
5862
description: "NPM authentication token (required if publish_npm is true)"
5963
required: false
@@ -176,6 +180,14 @@ runs:
176180
git stash drop >/dev/null 2>&1 || true
177181
fi
178182
183+
- name: Stop with neutral status on no changes
184+
if: inputs.neutral_on_no_changes == 'true' && steps.compare_npm.outputs.should_release == 'false'
185+
shell: bash
186+
run: |
187+
set -euo pipefail
188+
echo "::notice::No changes detected; marking workflow neutral."
189+
exit 78
190+
179191
- name: Auto changeset (patch if no changeset exists)
180192
id: auto_changeset
181193
if: steps.compare_npm.outputs.should_release != 'false' && github.actor != 'github-actions[bot]'

0 commit comments

Comments
 (0)