Skip to content

Commit

Permalink
Continue with publishing if the job was manually triggered
Browse files Browse the repository at this point in the history
The [`workflow_dispatch`] event occurs when the job is manually
triggered. Manually triggering a publish should skip the empty release
check.

[`workflow_dispatch`]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
  • Loading branch information
AzureMarker committed Jun 9, 2021
1 parent 7bd7b17 commit 05b17cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
shell: bash
run: |
# Check if we can skip releasing a new version
# (there are no changes and the job was not manually triggered)
export CHANGED=$(cargo workspaces changed --ignore-changes "**/Cargo.toml")
if [[ -z "$CHANGED" ]]; then
if [[ -z "$CHANGED" && "$GITHUB_EVENT_NAME" != "workflow_dispatch" ]]; then
# Nothing has changed, so don't publish a new version
exit 0
fi
Expand Down

0 comments on commit 05b17cd

Please sign in to comment.