File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update Runner Version
2+
3+ on :
4+ schedule :
5+ - cron : " 0 6 * * *"
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ update-runner :
13+ name : Check and update runner version
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@v4
17+ with :
18+ token : ${{ secrets.REPO_PAT }}
19+
20+ - name : Get latest runner version
21+ id : latest
22+ run : |
23+ VERSION=$(gh api repos/actions/runner/releases/latest --jq '.tag_name' | sed 's/^v//')
24+ echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
25+ env :
26+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27+
28+ - name : Get current runner version
29+ id : current
30+ run : |
31+ VERSION=$(grep -oP 'RUNNER_VERSION=\K\S+' manifest.yaml | head -1)
32+ echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
33+
34+ - name : Update version files
35+ if : steps.latest.outputs.version != steps.current.outputs.version
36+ env :
37+ CURRENT : ${{ steps.current.outputs.version }}
38+ LATEST : ${{ steps.latest.outputs.version }}
39+ run : |
40+ sed -i "s/RUNNER_VERSION=${CURRENT}/RUNNER_VERSION=${LATEST}/g" \
41+ Containerfile manifest.yaml
42+
43+ - name : Commit and push
44+ if : steps.latest.outputs.version != steps.current.outputs.version
45+ env :
46+ LATEST : ${{ steps.latest.outputs.version }}
47+ run : |
48+ git config user.name "github-actions[bot]"
49+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
50+ git add Containerfile manifest.yaml
51+ git commit -m "fix(deps): update github actions runner to ${LATEST}"
52+ git push
You can’t perform that action at this time.
0 commit comments