Skip to content

Bump Runner Versions #2

Bump Runner Versions

Bump Runner Versions #2

Workflow file for this run

name: Bump Runner Versions
on:
schedule:
- cron: "0 12 * * 4"
workflow_dispatch:
jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Github prevents workflow triggers on pushes made by GITHUB_TOKEN.
# You will have to issue a separate PAT with `contents: write` permissions.
token: ${{ secrets.PAT }}
- name: Fetch latest versions
id: latest
run: |
RUNNER=$(gh release view --repo actions/runner --json tagName -q '.tagName | ltrimstr("v")')
echo "Latest runner version: $RUNNER"
HOOKS=$(gh release view --repo actions/runner-container-hooks --json tagName -q '.tagName | ltrimstr("v")')
echo "Latest hooks version: $HOOKS"
cat > versions.env <<EOF
RUNNER_VERSION=$RUNNER
RUNNER_CONTAINER_HOOKS_VERSION=$HOOKS
EOF
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push
run: |
git diff --quiet versions.env && {
echo "Runner versions are already up-to-date."
exit 0
}
echo "Runner versions are outdated will be bumped."
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add versions.env
git commit -m "chore: bump runner versions"
git push