Skip to content

Commit 8dce07c

Browse files
committed
try with action
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
1 parent 7bc3e3f commit 8dce07c

1 file changed

Lines changed: 23 additions & 16 deletions

File tree

.github/workflows/demo-img-update.yaml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,31 @@ jobs:
1616
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
1717
- name: Install frizbee
1818
run: |
19-
mkdir bin && wget -q https://github.com/stacklok/frizbee/releases/download/v0.0.15/frizbee_0.0.15_linux_amd64.tar.gz -O - | tar xz -C bin
20-
chmod +x bin/frizbee
19+
export FRIZBEE_HASH=cda91f86d0c96d0bc3c464c57a601ca414e0b2415372eb19b9a4c82fa3d4f802
20+
export FRIZBEE_VERSION=0.0.15
21+
22+
mkdir /tmp/frizbee
23+
wget -q https://github.com/stacklok/frizbee/releases/download/v${FRIZBEE_VERSION}/frizbee_${FRIZBEE_VERSION}_linux_amd64.tar.gz -O /tmp/frizbee/frizbee.tar.gz
24+
cd /tmp/frizbee
25+
echo "$FRIZBEE_HASH frizbee.tar.gz" | sha256sum -c -
26+
tar xzf frizbee.tar.gz
27+
chmod +x /tmp/frizbee/frizbee
2128
- name: Run update script
2229
run: |
23-
export PATH=$PATH:$(pwd)/bin
24-
25-
git config user.name "Tuomas Katila"
26-
git config user.email "tuomas.katila@intel.com"
30+
export PATH=$PATH:/tmp/frizbee
31+
cd demo
32+
bash update-shas.sh
33+
- name: Get current date
34+
id: date
35+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
36+
- name: Create Pull Request
37+
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6
38+
with:
39+
commit-message: "demo: update base images ${{ steps.date.outputs.date }}"
40+
title: "Update demo base images (${{ steps.date.outputs.date }})"
41+
token: ${{ secrets.GH_PR_TOKEN }}
42+
body: >
43+
PR is auto-generated by GH action.
2744
28-
export DATE=$(date +'%m-%Y')
29-
export TITLE="Demo base update $DATE"
30-
export BRANCH="demo-base-update-$DATE"
3145
32-
export MAINHEAD=$(git rev-parse --short HEAD)
33-
git checkout -b $BRANCH
3446
35-
cd demo
36-
bash update-shas.sh
37-
git diff --exit-code || git add -u && git commit -s -m "demo: base image update $DATE" && git diff main...$BRANCH && gh pr create --fill --base=main --head=$BRANCH
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GH_PR_TOKEN }}

0 commit comments

Comments
 (0)