Skip to content

Commit 8c0f93c

Browse files
committed
have the cron job create rustup PRs automatically
1 parent 6798c27 commit 8c0f93c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,32 @@ jobs:
6969
- name: check if any dependency failed
7070
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
7171

72+
# Make a PR to update `rust-version` when the cron job succeeds.
73+
# The primary reason for this is that Github stops running our cron job
74+
# if there is no repo activity for a while, so we use these PRs to generate activity.
75+
cron-success-pr:
76+
name: automatic rustup PR
77+
runs-on: ubuntu-latest
78+
needs: [success]
79+
if: github.event_name == 'schedule'
80+
steps:
81+
- name: setup bot git name and email
82+
run: |
83+
git config --global user.name 'The Miri Conjob Bot'
84+
git config --global user.email '[email protected]'
85+
- name: Create PR
86+
run: |
87+
# Create commit
88+
DATE=$(date -u +%Y-%m-%d)
89+
echo "nightly-$DATE" > rust-version
90+
git commit -am "automatic rustup"
91+
# Switch to a PR branch
92+
BRANCH="rustup-$DATE"
93+
git switch -c $BRANCH
94+
git push -u origin $BRANCH
95+
# Create PR
96+
gh pr create -B master --title 'Automatic Rustup' --body ''
97+
7298
# Send a Zulip notification when a cron job fails
7399
cron-fail-notify:
74100
name: cronjob failure notification

0 commit comments

Comments
 (0)