Skip to content

Commit 47b9555

Browse files
committed
Run rustc-pull CI every day, don't notify when there is nothing to update
1 parent 88197e4 commit 47b9555

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

Diff for: .github/workflows/rustc-pull.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ name: rustc-pull
33
on:
44
workflow_dispatch:
55
schedule:
6-
# Run at 04:00 UTC every Monday
7-
- cron: '0 4 * * 1'
6+
# Run at 04:00 UTC every day
7+
- cron: '0 4 * * *'
88

99
jobs:
1010
pull:
1111
if: github.repository == 'rust-lang/rustc-dev-guide'
1212
runs-on: ubuntu-latest
1313
outputs:
1414
pr_url: ${{ steps.update-pr.outputs.pr_url }}
15+
pull_result: ${{ steps.rustc-pull.outputs.pull_result }}
1516
permissions:
1617
contents: write
1718
pull-requests: write
@@ -34,7 +35,18 @@ jobs:
3435
git config --global user.name 'The rustc-dev-guide Cronjob Bot'
3536
git config --global user.email '[email protected]'
3637
- name: Perform rustc-pull
37-
run: cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull
38+
id: rustc-pull
39+
# Turn off -e to disable early exit
40+
shell: bash {0}
41+
run: |
42+
cargo run --manifest-path josh-sync/Cargo.toml -- rustc-pull
43+
exitcode=$?
44+
45+
if [ $exitcode -eq 2 ]; then
46+
echo "pull_result=skipped" >> $GITHUB_OUTPUT
47+
fi
48+
49+
exit ${exitcode}
3850
- name: Push changes to a branch
3951
run: |
4052
# Update a sticky branch that is used only for rustc pulls
@@ -54,13 +66,14 @@ jobs:
5466
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
5567
else
5668
PR_URL=`gh pr list --author github-actions[bot] --state open -q 'map(select(.title=="Rustc pull update")) | .[0].url' --json url,title`
69+
echo "Updating pull request ${PR_URL}"
5770
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
5871
fi
5972
env:
6073
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6174
send-zulip-message:
6275
needs: [pull]
63-
if: ${{ !cancelled() }}
76+
if: ${{ !cancelled() && needs.pull.outputs.pull_result != 'skipped' }}
6477
runs-on: ubuntu-latest
6578
steps:
6679
- name: Compute message

0 commit comments

Comments
 (0)