Repository navigation
Bump actions/runner #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bump actions/runner | |
| # Opens a PR bumping the pinned default actions/runner version when a newer | |
| # release is available. Toil elimination only — no auto-merge; a human | |
| # reviews (runner updates occasionally break things) and the PR body cites | |
| # the checksum provenance so review is a link-click. | |
| on: | |
| schedule: | |
| - cron: '17 6 * * 1' # weekly, Monday 06:17 UTC | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Runner version to bump to (default: latest release)' | |
| required: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| bump: | |
| name: Bump runner version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - name: Resolve target and current versions | |
| id: versions | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| INPUT_VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| if [ -n "$INPUT_VERSION" ]; then | |
| target="$INPUT_VERSION" | |
| else | |
| target=$(gh api repos/actions/runner/releases/latest --jq .tag_name | sed 's/^v//') | |
| fi | |
| current=$(node -e "console.log(require('./scripts/bump-runner').readCurrentVersion('.'))") | |
| echo "target=$target" >> "$GITHUB_OUTPUT" | |
| echo "current=$current" >> "$GITHUB_OUTPUT" | |
| echo "Current: $current Target: $target" | |
| if [ "$target" = "$current" ]; then | |
| echo "up_to_date=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "up_to_date=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Check for an existing bump branch/PR | |
| id: existing | |
| if: steps.versions.outputs.up_to_date == 'false' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| branch="bot/bump-runner-${{ steps.versions.outputs.target }}" | |
| echo "branch=$branch" >> "$GITHUB_OUTPUT" | |
| if git ls-remote --exit-code --heads origin "refs/heads/$branch" >/dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| echo "Branch $branch already exists — skipping." | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Apply bump and rebuild dist | |
| if: steps.versions.outputs.up_to_date == 'false' && steps.existing.outputs.exists == 'false' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: node scripts/bump-runner.js "${{ steps.versions.outputs.target }}" | |
| - name: Open pull request | |
| if: steps.versions.outputs.up_to_date == 'false' && steps.existing.outputs.exists == 'false' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TARGET: ${{ steps.versions.outputs.target }} | |
| CURRENT: ${{ steps.versions.outputs.current }} | |
| BRANCH: ${{ steps.existing.outputs.branch }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "$BRANCH" | |
| git add -A | |
| git commit -m "fix: bump default actions/runner to $TARGET" | |
| git push origin "$BRANCH" | |
| # Single-quoted printf format so backticks stay literal (no command | |
| # substitution); %s are filled from the args. | |
| body=$(printf 'Automated bump of the default `actions/runner` from `%s` to `%s`.\n\n- Release notes: https://github.com/actions/runner/releases/tag/v%s\n- Checksums are taken from that release body and verified by the `verify-runner-url` CI job.\n\nGenerated by `.github/workflows/bump-runner.yml` via `scripts/bump-runner.js`. Review and merge — no auto-merge.' "$CURRENT" "$TARGET" "$TARGET") | |
| gh pr create \ | |
| --base main \ | |
| --head "$BRANCH" \ | |
| --title "fix: bump default actions/runner to $TARGET" \ | |
| --body "$body" |