Skip to content

Commit 3495b70

Browse files
committed
Include rust git logs in toolchain update PRs
Fetch the commit hashes that nightly builds correspond to and construct a git log for the changes between two nightly releases. This should simplify tracking down which upstream changes may cause our builds or tests to break.
1 parent 8d7f501 commit 3495b70

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/toolchain-upgrade.yml

+21-3
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,35 @@ jobs:
2424
echo "next_toolchain_date=$next_toolchain_date" >> $GITHUB_ENV
2525
sed -i "/^channel/ s/$current_toolchain_date/$next_toolchain_date/" rust-toolchain.toml
2626
git diff
27+
git clone https://github.com/rust-lang/rust rust.git
28+
cd rust.git
29+
current_toolchain_hash=$(curl https://static.rust-lang.org/dist/$current_toolchain_date/channel-rust-nightly-git-commit-hash.txt)
30+
echo "current_toolchain_hash=$current_toolchain_hash" >> $GITHUB_ENV
31+
next_toolchain_hash=$(curl https://static.rust-lang.org/dist/$next_toolchain_date/channel-rust-nightly-git-commit-hash.txt)
32+
echo "next_toolchain_hash=$next_toolchain_hash" >> $GITHUB_ENV
33+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
34+
echo "git_log<<$EOF" >> $GITHUB_ENV
35+
git log --oneline $current_toolchain_hash..$next_toolchain_hash | \
36+
sed 's#^#https://github.com/rust-lang/rust/commit/#' >> $GITHUB_ENV
37+
echo "$EOF" >> $GITHUB_ENV
38+
cd ..
39+
rm -rf rust.git
2740
- name: Create Pull Request
2841
uses: peter-evans/create-pull-request@v4
2942
with:
3043
commit-message: Upgrade Rust toolchain to nightly-${{ env.next_toolchain_date }}
3144
branch: toolchain-${{ env.next_toolchain_date }}
3245
delete-branch: true
3346
title: 'Automatic toolchain upgrade to nightly-${{ env.next_toolchain_date }}'
34-
body: |
47+
body: >
3548
Update Rust toolchain from nightly-${{ env.current_toolchain_date }} to
3649
nightly-${{ env.next_toolchain_date }} without any other source changes.
3750
38-
Thiis is an automatically generated pull request. If any of the CI checks fail,
51+
This is an automatically generated pull request. If any of the CI checks fail,
3952
manual intervention is required. In such a case, review the changes at
40-
https://github.com/rust-lang/rust.
53+
https://github.com/rust-lang/rust from
54+
https://github.com/rust-lang/rust/commit/${{ env.current_toolchain_hash }} up to
55+
https://github.com/rust-lang/rust/commit/${{ env.next_toolchain_hash }}. The log
56+
for this commit range is:
57+
58+
${{ env.git_log }}

0 commit comments

Comments
 (0)