Skip to content

Commit 6049872

Browse files
Nightly releases cancel on no changes (#83)
1 parent 4f338f7 commit 6049872

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/publish_release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ jobs:
4242
- id: should_run
4343
continue-on-error: true
4444
name: check latest commit is less than a day
45-
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
45+
run: |
46+
test -z $(git rev-list --after="24 hours" ${{ github.sha }}) \
47+
&& echo "::set-output name=should_run::false" \
48+
|| (gh run cancel ${{ github.run_id }} \
49+
&& gh run watch ${{ github.run_id }})
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4652
publish_release:
4753
needs: check_date
4854
if: ${{ github.event_name == 'workflow_dispatch' || needs.check_date.outputs.should_run != 'false' }}

0 commit comments

Comments
 (0)