@@ -132,15 +132,35 @@ jobs:
132132 echo "MERGE_CONFLICTS=maybe" >> $GITHUB_ENV
133133 fi
134134
135+ - name : Create Pull Request to update subtree/library
136+ if : ${{ env.MERGE_CONFLICTS != 'noop' && env.SUBTREE_PR_EXISTS == 'no' }}
137+ uses : peter-evans/create-pull-request@v7
138+ with :
139+ title : ' Update subtree/library to ${{ env.NEXT_TOOLCHAIN_DATE }}'
140+ body : >
141+ This is an automated PR to update the subtree/library branch to the changes
142+ from ${{ env.CURRENT_TOOLCHAIN_DATE }} (rust-lang/rust@${{ env.CURRENT_COMMIT_HASH }})
143+ to ${{ env.NEXT_TOOLCHAIN_DATE }} (rust-lang/rust@${{ env.NEXT_COMMIT_HASH }}), inclusive.
144+
145+ **Review this PR as usual, but do not merge this PR using the GitHub web interface.
146+ Instead, once it is approved, use `git push` to literally push the changes to `subtree/library`
147+ without any rebase or merge.**
148+ branch : update-subtree/library
149+ delete-branch : true
150+ base : subtree/library
151+ path : verify-rust-std
152+
135153 - name : Merge subtree/library changes
136154 if : ${{ env.MERGE_CONFLICTS != 'noop' && env.MERGE_PR_EXISTS == 'no' }}
137155 run : |
138- # The below must be done before any call to the create-pull-request
139- # action as said action resets branches locally, implying that
140- # `subtree/library` no longer is what the above instructions created.
141156 cd verify-rust-std
142- if ! git rev-parse --verify subtree/library; then
157+ # create-pull-request resets branches locally, implying that
158+ # `subtree/library` no longer is what the above instructions created.
159+ if [ "${SUBTREE_PR_EXISTS}" = "yes" ]; then
143160 git checkout -t -b subtree/library origin/update-subtree/library
161+ else
162+ git checkout subtree/library
163+ git reset --hard origin/update-subtree/library
144164 fi
145165 git checkout main
146166
@@ -173,24 +193,6 @@ jobs:
173193 git -c user.name=gitbot -c user.email=git@bot \
174194 commit -m "Update Kani version to ${KANI_COMMIT_HASH}" tool_config/kani-version.toml
175195
176- - name : Create Pull Request to update subtree/library
177- if : ${{ env.MERGE_CONFLICTS != 'noop' && env.SUBTREE_PR_EXISTS == 'no' }}
178- uses : peter-evans/create-pull-request@v7
179- with :
180- title : ' Update subtree/library to ${{ env.NEXT_TOOLCHAIN_DATE }}'
181- body : >
182- This is an automated PR to update the subtree/library branch to the changes
183- from ${{ env.CURRENT_TOOLCHAIN_DATE }} (rust-lang/rust@${{ env.CURRENT_COMMIT_HASH }})
184- to ${{ env.NEXT_TOOLCHAIN_DATE }} (rust-lang/rust@${{ env.NEXT_COMMIT_HASH }}), inclusive.
185-
186- **Review this PR as usual, but do not merge this PR using the GitHub web interface.
187- Instead, once it is approved, use `git push` to literally push the changes to `subtree/library`
188- without any rebase or merge.**
189- branch : update-subtree/library
190- delete-branch : true
191- base : subtree/library
192- path : verify-rust-std
193-
194196 - name : Create Pull Request without conflicts
195197 if : ${{ env.MERGE_CONFLICTS == 'no' && env.MERGE_PR_EXISTS == 'no' }}
196198 uses : peter-evans/create-pull-request@v7
0 commit comments