File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 4242
4343 # Exit with error if open and S-waiting-on-bors
4444 if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then
45- exit 1
45+ gh run cancel ${{ github.run_id }}
4646 fi
4747
4848 update :
6565
6666 - name : cargo update
6767 # Remove first line that always just says "Updating crates.io index"
68- run : cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
68+ # If there are no changes, cancel the job here
69+ run : |
70+ cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
71+ git status --porcelain | grep -q Cargo.lock || gh run cancel ${{ github.run_id }}
6972 - name : upload Cargo.lock artifact for use in PR
7073 uses : actions/upload-artifact@v3
7174 with :
@@ -131,7 +134,7 @@ jobs:
131134 # Exit with error if PR is closed
132135 STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state')
133136 if [[ "$STATE" != "OPEN" ]]; then
134- exit 1
137+ gh run cancel ${{ github.run_id }}
135138 fi
136139
137140 gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY
You can’t perform that action at this time.
0 commit comments