@@ -147,27 +147,40 @@ jobs:
147
147
- uses : actions/checkout@v4
148
148
with :
149
149
fetch-depth : 256 # get a bit more of the history
150
- - name : install josh-proxy
151
- run : cargo +stable install josh-proxy --git https://github.com/josh-project /josh --tag r24.10.04
150
+ - name : install josh-sync
151
+ run : cargo +stable install --locked --git https://github.com/rust-lang /josh-sync
152
152
- name : setup bot git name and email
153
153
run : |
154
154
git config --global user.name 'The Miri Cronjob Bot'
155
155
git config --global user.email '[email protected] '
156
156
- name : Install nightly toolchain
157
157
run : rustup toolchain install nightly --profile minimal
158
- - name : get changes from rustc
159
- run : ./miri rustc-pull
160
158
- name : Install rustup-toolchain-install-master
161
159
run : cargo install -f rustup-toolchain-install-master
162
- - name : format changes (if any)
160
+ - name : Push changes to a branch and create PR
163
161
run : |
162
+ # Temporarily disable early exit to examine the status code of rustc-josh-sync
163
+ set +e
164
+ rustc-josh-sync pull
165
+ exitcode=$?
166
+ set -e
167
+
168
+ # If there were no changes to pull, rustc-josh-sync returns status code 2
169
+ # In that case skip the rest of the job
170
+ if [ $exitcode -eq 2 ]; then
171
+ echo "Nothing changed in rustc, skipping PR"
172
+ exit 0
173
+ elif [ $exitcode -ne 0 ]; then
174
+ # If return code was not 0 or 2, rustc-josh-sync actually failed
175
+ echo "rustc-josh-sync failed"
176
+ exit ${exitcode}
177
+ fi
178
+
179
+ # Format changes
164
180
./miri toolchain
165
181
./miri fmt --check || (./miri fmt && git commit -am "fmt")
166
- - name : Push changes to a branch and create PR
167
- run : |
168
- # `git diff --exit-code` "succeeds" if the diff is empty.
169
- if git diff --exit-code HEAD^; then echo "Nothing changed in rustc, skipping PR"; exit 0; fi
170
- # The diff is non-empty, create a PR.
182
+
183
+ # Create a PR
171
184
BRANCH="rustup-$(date -u +%Y-%m-%d)"
172
185
git switch -c $BRANCH
173
186
git push -u origin $BRANCH
0 commit comments