Skip to content

Commit

Permalink
ci: edit cron-update-rust
Browse files Browse the repository at this point in the history
  • Loading branch information
ValuedMammal committed Aug 21, 2024
1 parent a96dd9c commit a8f4ae9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Update stable rustc
on:
schedule:
- cron: "0 0 * * 6" # runs every Saturday 00:00
- cron: "0 0 1,15 * *" # At 00:00 on day-of-month 1 and 15.
workflow_dispatch: # allows manual triggering
jobs:
format:
Expand All @@ -14,10 +14,10 @@ jobs:
run: |
set -x
# Extract the date from whatever version of the compiler dtolnay/rust-toolchain gives us.
RUSTC_VERSION=$(rustc --verbose --version | sed -ne 's/^release: //p')
RUST_VERSION=$(rustc --verbose --version | sed -ne 's/^release: //p')
# Update the version in the reference file.
echo "${RUSTC_VERSION}" > rustc-version
echo "rustc_version=${RUSTC_VERSION}" >> $GITHUB_ENV
echo "${RUST_VERSION}" > rust-version
echo "rust_version=${RUST_VERSION}" >> $GITHUB_ENV
# In case of no new version don't make an empty PR.
if ! git diff --exit-code > /dev/null; then
echo "Updated rustc. Opening PR."
Expand All @@ -33,8 +33,8 @@ jobs:
token: ${{ secrets.CREATE_PR_TOKEN }}
author: Update Rustc Bot <bot@example.com>
committer: Update Rustc Bot <bot@example.com>
title: Automated weekly update to rustc (to ${{ env.rustc_version }})
title: Automated weekly update to rustc (to ${{ env.rust_version }})
body: |
Automated update to Github CI workflow `rust.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
commit-message: Automated update to Github CI to rustc ${{ env.rustc_version }}
commit-message: Automated update to Github CI to rustc ${{ env.rust_version }}
branch: create-pull-request/weekly-stable-update
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
Prepare:
runs-on: ubuntu-latest
outputs:
rustc_version: ${{ steps.read_toolchain.outputs.rustc_version }}
rust_version: ${{ steps.read_toolchain.outputs.rust_version }}
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Read rustc version"
id: read_toolchain
run: echo "rustc_version=$(cat rustc-version)" >> $GITHUB_OUTPUT
run: echo "rust_version=$(cat rust-version)" >> $GITHUB_OUTPUT

Check:
runs-on: ubuntu-latest
Expand All @@ -40,7 +40,7 @@ jobs:
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.rustc_version }}
toolchain: ${{ needs.Prepare.outputs.rust_version }}
- name: "Install clippy"
run: rustup component add clippy
- name: "Lint"
Expand Down
File renamed without changes.

0 comments on commit a8f4ae9

Please sign in to comment.