@@ -156,13 +156,13 @@ jobs:
156156 - name : mark the job as a failure
157157 run : exit 1
158158
159- # Send a Zulip notification when a cron job fails
160159 cron-fail-notify :
161160 name : cronjob failure notification
162161 runs-on : ubuntu-latest
163162 needs : [build, style]
164163 if : github.event_name == 'schedule' && (failure() || cancelled())
165164 steps :
165+ # Send a Zulip notification
166166 - name : Install zulip-send
167167 run : pip3 install zulip
168168 - name : Send Zulip notification
@@ -185,3 +185,27 @@ jobs:
185185 Sincerely,
186186 The Miri Cronjobs Bot' \
187187 --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com
188+ # Attempt to auto-sync with rustc
189+ - name : install josh-proxy
190+ run : cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06
191+ - name : start josh-proxy
192+ run : josh-proxy --local=$HOME/.cache/josh --remote=https://github.com --no-background &
193+ - name : setup bot git name and email
194+ run : |
195+ git config --global user.name 'The Miri Conjob Bot'
196+ git config --global user.email 'miri@cron.bot'
197+ - name : get changes from rustc
198+ run : ./miri rustc-pull
199+ - name : format changes (if any)
200+ run : |
201+ ./miri toolchain
202+ ./miri fmt --check || (./miri fmt && git commit -am "fmt")
203+ - name : Push changes to a branch
204+ run : |
205+ git switch -c "rustup$(date -u +%Y-%m)"
206+ git push
207+ - name : Create Pull Request
208+ run : gh pr create -B master --title 'Automatic sync from rustc' --body ''
209+ env :
210+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
211+
0 commit comments