diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-23 15:00:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-23 15:00:17 +0100 |
| commit | 154d0962ee5b4b17d2c242d995777d550058207a (patch) | |
| tree | f1f3054741371a4036e52614b11fe35f26bda18c /.github/workflows | |
| parent | 71ce3c26e625b1af4b586ec291564d32a8eeb5f0 (diff) | |
| parent | 986f23e57d7bcce360941f7041a1a0cd9278c6a8 (diff) | |
Rollup merge of #122698 - clubby789:cancel-hourly-update, r=Mark-Simulacrum
Cancel `cargo update` job if there's no updates Previously there were always updates so we didn't hit this. Since #122489, this job runs on a more frequent schedule and causes errors if there have been no changes in that timespan. This led to a weird error on https://github.com/rust-lang/rust/pull/122646#issuecomment-2004339093 - because of this I've replaced the `exit 1`s here with `gh run cancel` so we don't have false 'failed' jobs in the logs.
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/dependencies.yml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index c182f3245e5..d7a31c8e80f 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -42,7 +42,7 @@ jobs: # Exit with error if open and S-waiting-on-bors if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then - exit 1 + gh run cancel ${{ github.run_id }} fi update: @@ -65,7 +65,10 @@ jobs: - name: cargo update # Remove first line that always just says "Updating crates.io index" - run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log + # If there are no changes, cancel the job here + run: | + cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log + git status --porcelain | grep -q Cargo.lock || gh run cancel ${{ github.run_id }} - name: upload Cargo.lock artifact for use in PR uses: actions/upload-artifact@v3 with: @@ -131,7 +134,7 @@ jobs: # Exit with error if PR is closed STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state') if [[ "$STATE" != "OPEN" ]]; then - exit 1 + gh run cancel ${{ github.run_id }} fi gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY |
