Skip to content

Commit

Permalink
chore(ci): add a workflow to bump the runner version
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed Feb 22, 2024
1 parent be36cbf commit 86db32f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/bump-runner-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bump the runner version

on:
workflow_dispatch:
inputs:
version:
description: "Runner version"
required: true

permissions:
contents: write
pull-requests: write

jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Bump
run: |
# Check that the version is a valid semver
if ! echo "${{ github.event.inputs.version }}" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Invalid version"
exit 1
fi
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
echo "Bumping runner version to ${{ github.event.inputs.version }}"
BRANCH_NAME=bump-runner-version/${{ github.event.inputs.version }}
git checkout -b $BRANCH_NAME
echo ${{ github.event.inputs.version }} > .codspeed-runner-version
git add .codspeed-runner-version
git commit -m "Bump runner version to ${{ github.event.inputs.version }}"
git push origin $BRANCH_NAME
gh pr create --title "Bump runner version to ${{ github.event.inputs.version }}" --body "Bump runner version to ${{ github.event.inputs.version }}" --base main --head $BRANCH_NAME

0 comments on commit 86db32f

Please sign in to comment.