RUNNER_VERSION bump #1203
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: RUNNER_VERSION bump | |
| # This workflow pulls the latest official actions runner version using GH API | |
| # and update RUNNER_VERSION file in the repo root. | |
| # If a change happens, the change will be commited in a versioned branch and | |
| # a PR will be created. Upon merging, the branch will be deleted. | |
| # | |
| # The workflow can be triggered manually (workflow_dispatch) but also runs nightly | |
| # before the nightly rebuild. | |
| on: | |
| schedule: | |
| - cron: '00 17 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| bump_version: | |
| runs-on: ubuntu-slim | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Get latest runner release | |
| id: release | |
| run: | | |
| ACTIONS_VERSION=$(curl -L https://api.github.com/repos/actions/runner/releases/latest | jq -r '.name[1:]') | |
| if [ "${ACTIONS_VERSION}" == "null" ] | |
| then | |
| echo "::error Invalid ACTIONS_VERSION ${ACTIONS_VERSION}" | |
| exit 1 | |
| fi | |
| echo "ACTIONS_VERSION=${ACTIONS_VERSION}" >> $GITHUB_OUTPUT | |
| - name: Update release | |
| run: | | |
| echo "${{ steps.release.outputs.ACTIONS_VERSION }}" > RUNNER_VERSION | |
| - name: Create Pull Request | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RUNNER_VERSION: ${{ steps.release.outputs.ACTIONS_VERSION }} | |
| BRANCH: version-bump/${{ steps.release.outputs.ACTIONS_VERSION }} | |
| run: | | |
| if git diff --quiet; then | |
| echo "No changes to commit" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "${BRANCH}" | |
| git add -A | |
| git commit -m "[automated] Bump RUNNER_VERSION to v${RUNNER_VERSION}" | |
| git push -u origin "${BRANCH}" | |
| gh pr create \ | |
| --title "[automated] Bump RUNNER_VERSION to v${RUNNER_VERSION}" \ | |
| --body "" \ | |
| --reviewer anakryiko,danielocfb,theihor |