Git Product home page Git Product logo

update-rust-toolchain's Introduction

update-rust-toolchain

Matrix Chat Room

This is a GitHub Action that will update your rust-toolchain / rust-toolchain.toml file, when it is run.

Keep a shared rust version for your project, while also keeping it up to date.

Update patch versions as soon as they release, or even update your minor versions.

Will usually take between 3-6 seconds to execute.

Usage:

Creates a pr with an update to the latest rust-version.

jobs:
  rust-toolchain:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Update rust-toolchain
        uses: a-kenji/update-rust-toolchain

Creates a pr with an update to the latest patch of your selected rust-version.

jobs:
  rust-toolchain:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Update rust-toolchain
        uses: a-kenji/update-rust-toolchain
        with:
          update-minor: false

Running GitHub Actions on the Action

GitHub Actions will not trigger workflows by a PR that is itself opened by a GitHub Action: Triggering a workflow from a workflow. There are three ways to have GitHub Actions CI run on a PR submitted by this action.

Manually

You can manually run the following commands, in order to force a CI run of the PR.

git branch -D update_rust_toolchain_action
git fetch origin
git checkout update_rust_toolchain_action
git commit --amend --no-edit
git push origin update_rust_toolchain_action --force

With a Personal Authentication Token

By providing a Personal Authentication Token(Using the GITHUB_TOKEN in a Workflow), the PR will be submitted in a way that bypasses this limitation (GitHub will essentially think it is the owner of the PAT submitting the PR, and not an Action). You can create a token by visiting https://github.com/settings/tokens and select at least the repo scope. Then, store this token in your repository secrets (i.e. https://github.com/<USER>/<REPO>/settings/secrets/actions) as GH_TOKEN_FOR_UPDATES and set up your workflow file like the following:

name: update-rust-toolchain
on:
  workflow_dispatch: # allows manual triggering
  schedule:
    - cron: '0 9 * * sun' # runs at 9 am on every sunday

jobs:
  update-rust-toolchain:
    name: "Update rust-toolchain"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: update rust toolchain
        uses: a-kenji/update-rust-toolchain@v1
        with:
          token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}

It is additionally recommended to scope the environment variable in an environment, if possible.

With a label trigger

An action can be set up to be triggered on adding a label, such as pr-run-tests. Please note that this follows the same rules as a pr itself, so if an action sets the label, the workflow will not be run.

Currently supports:

  • Toolchain files in the following format:

rust-toolchain

1.45.0

rust-toolchain.toml

[toolchain]
channel = "1.45.0"
components = ["rustfmt", "clippy", "rust-analysis"]
targets = ["wasm32-wasi"]

Channels with the Beta, or Nightly prefix are not yet supported.

update-rust-toolchain's People

Contributors

a-kenji avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

update-rust-toolchain's Issues

Author as bot account?

Currently the author is set to me in PRQL/prql#928. Is it possible to have it as a bot account, like update-rust-toolchain?

This is the case for Dependabot and pre-commit.ci, though those are apps rather than workflows so might be different. It would also give this action lots of contributions, which could be good for getting the word out...

Thank you again!

Running on a fork

Not a huge deal for us, but thought it might be helpful to have a report.

Should this run successfully on a fork, at least passing if it's up to date? I recently worked on a change to another task in our nightly workflow from my fork, and this action is failing: https://github.com/PRQL/prql/actions/runs/3981448796/jobs/6825188472:

  /usr/bin/git symbolic-ref HEAD --short
  fatal: ref HEAD is not a symbolic ref

It's been running very successfully every night on main, hence my suspicion that it's because of the fork.

Thanks again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.