Skip to content

Commit 7af808f

Browse files
authored
gitActions: Add workflow to bump kubevirtci tag (#2217)
Run it every 3 months to keep things up to date. Signed-off-by: Ram Lavi <[email protected]>
1 parent b463e5b commit 7af808f

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Bump KubevirtCI
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 1,4,7,10 *' # every 3 months (00:00 UTC on the 1st of Jan, Apr, Jul, Oct)
6+
workflow_dispatch:
7+
8+
jobs:
9+
bump-kubevirtci:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Git config
20+
run: |
21+
git config user.name "github-actions[bot]"
22+
git config user.email "github-actions[bot]@users.noreply.github.com"
23+
24+
- name: Bump KubevirtCI to latest tag
25+
run: |
26+
./hack/bump-kubevirtci.sh
27+
28+
- name: Check for changes
29+
id: changes
30+
run: |
31+
if git diff --quiet cluster/cluster.sh; then
32+
echo "changed=false" >> $GITHUB_OUTPUT
33+
else
34+
echo "changed=true" >> $GITHUB_OUTPUT
35+
fi
36+
37+
- name: Extract new tag from cluster.sh
38+
if: steps.changes.outputs.changed == 'true'
39+
id: extract
40+
run: |
41+
NEW_TAG=$(grep -oP 'KUBEVIRTCI_TAG:-\K[^}]+' cluster/cluster.sh)
42+
echo "Detected new tag: $NEW_TAG"
43+
echo "tag=$NEW_TAG" >> $GITHUB_OUTPUT
44+
45+
- name: Create Pull Request
46+
if: steps.changes.outputs.changed == 'true'
47+
uses: peter-evans/create-pull-request@v5
48+
with:
49+
token: ${{ secrets.KUBEVIRT_BOT_TOKEN }}
50+
committer: GitHub <[email protected]>
51+
commit-message: "Bump KubevirtCI"
52+
title: "cluster: Bump KubevirtCI"
53+
signoff: true
54+
branch: bump_kubevirtci_${{ github.run_id }}
55+
body: |
56+
**What this PR does / why we need it**:
57+
This PR updates relevant KubevirtCI components to latest available.
58+
59+
```release-note
60+
NONE
61+
```

0 commit comments

Comments
 (0)