Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions .github/VERSION_CHECK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "chore: rust toolchain needs an upgrade"
labels: debt, automated-issues
---

The rust version specified in `rust-toolchain.toml` is out of date with the latest stable.

Check the [rust version check]({{env.WORKFLOW_URL}}) workflow for details.

This issue was raised by the workflow at `https://github.com/lurk-lab/ci-workflows/tree/main/.github/workflows/rust-version-check.yml`.
46 changes: 46 additions & 0 deletions .github/workflows/rust-version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Rust Version Check


on:
workflow_call:

jobs:
rust-version-check:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Get Local Rust Version
id: get-rust-version
run: echo "RUST_VERSION=$(rustc --version | awk '{print $2}')" >> $GITHUB_ENV

- name: Parse rust-toolchain.toml
id: parse-toolchain
run: |
CHANNEL=$(awk -F'\"' '/channel/ {print $2}' rust-toolchain.toml)
if [[ $CHANNEL =~ ^[0-9]+\.[0-9]+$ ]]; then
echo "TOOLCHAIN_VERSION=$CHANNEL" >> $GITHUB_ENV
else
echo "TOOLCHAIN_VERSION=stable" >> $GITHUB_ENV
fi

- name: Compare Rust Versions
id: compare-versions
run: |
if [[ $TOOLCHAIN_VERSION != "stable" && $TOOLCHAIN_VERSION < $RUST_VERSION ]]; then
echo "VERSION_MISMATCH=true" >> $GITHUB_ENV
else
echo "VERSION_MISMATCH=false" >> $GITHUB_ENV

- uses: JasonEtco/create-an-issue@v2
if: env.VERSION_MISMATCH == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/VERSION_CHECK.md