Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI job to update nightly version #1204

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/update-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,31 @@ jobs:
LATEST_NIGHTLY=$(echo $RUSTC_VERSION | grep -Po '\d{4}-\d{2}-\d{2}')
echo "LATEST_NIGHTLY=$LATEST_NIGHTLY" >> $GITHUB_ENV

- name: Create new branch
run: |
git checkout -b update-rust-nightly-$LATEST_NIGHTLY

- name: Update nightly version in CI workflow
run: |
FILE=".github/workflows/rust.yml"
sed -i "s/toolchain: nightly-[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/toolchain: nightly-$LATEST_NIGHTLY/" $FILE

- name: Commit and push changes
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .github/workflows/rust.yml
git commit -m "Update Rust nightly version to $LATEST_NIGHTLY"
git push

- name: Push changes to new branch
run: |
git push origin update-rust-nightly-$LATEST_NIGHTLY

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-rust-nightly-$LATEST_NIGHTLY
title: "CI: Update Rust nightly version to $LATEST_NIGHTLY"
body: "This PR updates the Rust nightly version to $LATEST_NIGHTLY."
base: main
Loading