-
Notifications
You must be signed in to change notification settings - Fork 54
53 lines (47 loc) · 1.64 KB
/
update-bootc-image-builder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This action updates the bootc-image-builder ref in the Schutzfile
---
name: "Update bootc-image-builder ref"
on:
workflow_dispatch:
schedule:
# Every day at 05:00
- cron: "0 5 * * *"
jobs:
update-and-push:
runs-on: ubuntu-latest
steps:
- name: Apt update
run: sudo apt update
- name: Install Dependencies
run: sudo apt install -y skopeo python3
- name: Check out main
uses: actions/checkout@v4
with:
path: images
ref: main
- name: Update Schutzfile
working-directory: ./images
run: |
./test/scripts/update-schutzfile-bib
- name: Open PR
working-directory: ./images
env:
GITHUB_TOKEN: ${{ secrets.SCHUTZBOT_GITHUB_ACCESS_TOKEN }}
run: |
if git diff --exit-code; then echo "No changes"; exit 0; fi
git config --unset-all http.https://github.com/.extraheader
git config user.name "schutzbot"
git config user.email "[email protected]"
branch="schutzfile-bib-$(date -I)"
git checkout -b "${branch}"
git add Schutzfile
git commit -m "schutzfile: Update bootc-image-builder ref"
git push -f https://"$GITHUB_TOKEN"@github.com/schutzbot/images.git
new_ref="$(jq -r '.common."bootc-image-builder".ref' Schutzfile)"
echo "Updating bootc-image-builder test container ref to ${new_ref}" > body
gh pr create \
-t "Update bootc-image-builder ref to latest" \
-F "body" \
--repo "osbuild/images" \
--base "main" \
--head "schutzbot:${branch}"