Skip to content

Commit

Permalink
Nightly releases cancel on no changes (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
stas-panasiuk authored Jul 31, 2024
1 parent 4f338f7 commit 6049872
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ jobs:
- id: should_run
continue-on-error: true
name: check latest commit is less than a day
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
run: |
test -z $(git rev-list --after="24 hours" ${{ github.sha }}) \
&& echo "::set-output name=should_run::false" \
|| (gh run cancel ${{ github.run_id }} \
&& gh run watch ${{ github.run_id }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_release:
needs: check_date
if: ${{ github.event_name == 'workflow_dispatch' || needs.check_date.outputs.should_run != 'false' }}
Expand Down

0 comments on commit 6049872

Please sign in to comment.