Skip to content

Commit a336c97

Browse files
add soci & ecr-cred-helper conf & update workflow
Signed-off-by: Swapnanil Gupta <swpnlg@amazon.com>
1 parent 4151f58 commit a336c97

File tree

5 files changed

+162
-0
lines changed

5 files changed

+162
-0
lines changed

.github/workflows/update-dependencies.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ on:
1616
- .github/workflows/update-dependencies.yaml
1717
- .github/workflows/update-linux-dependencies.yaml
1818
- .github/workflows/update-qemu.yaml
19+
- .github/workflows/update-ecr-cred-helper.yaml
20+
- .github/workflows/update-soci.yaml
1921
- bin/update-lima-bundles.sh
2022
- bin/update-container-runtime-full-archive.sh
2123
- bin/update-linux-dependencies.sh
@@ -144,3 +146,19 @@ jobs:
144146
pull-requests: write
145147

146148
uses: ./.github/workflows/update-qemu.yaml
149+
150+
update-ecr-cred-helper:
151+
# Add permissions needed to create a PR
152+
permissions:
153+
contents: write
154+
pull-requests: write
155+
156+
uses: ./.github/workflows/update-ecr-cred-helper.yaml
157+
158+
update-soci:
159+
# Add permissions needed to create a PR
160+
permissions:
161+
contents: write
162+
pull-requests: write
163+
164+
uses: ./.github/workflows/update-soci.yaml
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: update-ecr-cred-helper
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
update-ecr-cred-helper-and-create-pr:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get latest ECR Cred Helper Version
21+
id: version
22+
run: |
23+
latest_tag="$(\
24+
curl -sL --fail "https://api.github.com/repos/awslabs/amazon-ecr-credential-helper/releases/latest" | \
25+
grep '"tag_name":' | \
26+
head -1 | \
27+
cut -d'"' -f4 \
28+
)"
29+
echo "tag=$latest_tag" >> $GITHUB_OUTPUT
30+
echo "Latest tag is ${latest_tag}"
31+
32+
- name: Update .conf file
33+
run: |
34+
latest_tag="${{ steps.version.outputs.tag }}"
35+
AMD64_DIGEST=$(curl -sL --fail "https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${latest_tag#v}/linux-amd64/docker-credential-ecr-login.sha256" | awk '{print $1}')
36+
ARM64_DIGEST=$(curl -sL --fail "https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/${latest_tag#v}/linux-arm64/docker-credential-ecr-login.sha256" | awk '{print $1}')
37+
38+
cat > deps/ecr-cred-helper.conf << EOF
39+
VERSION=${latest_tag#v}
40+
AMD64_DIGEST=sha256:${AMD64_DIGEST}
41+
ARM64_DIGEST=sha256:${ARM64_DIGEST}
42+
EOF
43+
44+
- name: Check for changes
45+
id: changes
46+
run: |
47+
if git diff --quiet deps/ecr-cred-helper.conf; then
48+
echo "changed=false" >> $GITHUB_OUTPUT
49+
echo "No changes detected in dependencies"
50+
exit 0
51+
else
52+
echo "changed=true" >> $GITHUB_OUTPUT
53+
echo "Changes detected in dependencies:"
54+
git diff deps/ecr-cred-helper.conf
55+
fi
56+
57+
- name: Create or update PR
58+
if: github.event_name != 'pull_request' && steps.changes.outputs.changed == 'true'
59+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
60+
with:
61+
token: ${{ secrets.GITHUB_TOKEN }}
62+
signoff: true
63+
commit-message: 'chore: update ecr-cred-helper'
64+
title: 'chore: update ecr-cred-helper'
65+
body: |
66+
This PR updates ecr-cred-helper to the latest version
67+
This is an automated update created by the dependency update workflow. Review the changes before approving.
68+
branch: update-ecr-cred-helper
69+
delete-branch: true

.github/workflows/update-soci.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: update-soci
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
update-soci-and-create-pr:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get latest ECR Cred Helper Version
21+
id: version
22+
run: |
23+
latest_tag="$(\
24+
curl -sL --fail "https://api.github.com/repos/awslabs/soci-snapshotter/releases/latest" | \
25+
grep '"tag_name":' | \
26+
head -1 | \
27+
cut -d'"' -f4 \
28+
)"
29+
echo "tag=$latest_tag" >> $GITHUB_OUTPUT
30+
echo "Latest tag is ${latest_tag}"
31+
32+
- name: Update .conf file
33+
run: |
34+
latest_tag="${{ steps.version.outputs.tag }}"
35+
AMD64_DIGEST=$(curl -sL --fail "https://github.com/awslabs/soci-snapshotter/releases/download/${latest_tag}/soci-snapshotter-${latest_tag#v}-linux-amd64.tar.gz.sha256sum" | awk '{print $1}')
36+
ARM64_DIGEST=$(curl -sL --fail "https://github.com/awslabs/soci-snapshotter/releases/download/${latest_tag}/soci-snapshotter-${latest_tag#v}-linux-arm64.tar.gz.sha256sum" | awk '{print $1}')
37+
38+
cat > deps/soci.conf << EOF
39+
VERSION=${latest_tag#v}
40+
AMD64_SHA256_DIGEST=${AMD64_DIGEST}
41+
ARM64_SHA256_DIGEST=${ARM64_DIGEST}
42+
EOF
43+
44+
- name: Check for changes
45+
id: changes
46+
run: |
47+
if git diff --quiet deps/soci.conf; then
48+
echo "changed=false" >> $GITHUB_OUTPUT
49+
echo "No changes detected in dependencies"
50+
exit 0
51+
else
52+
echo "changed=true" >> $GITHUB_OUTPUT
53+
echo "Changes detected in dependencies:"
54+
git diff deps/soci.conf
55+
fi
56+
57+
- name: Create or update PR
58+
if: github.event_name != 'pull_request' && steps.changes.outputs.changed == 'true'
59+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
60+
with:
61+
token: ${{ secrets.GITHUB_TOKEN }}
62+
signoff: true
63+
commit-message: 'chore: update SOCI Snapshotter'
64+
title: 'chore: update SOCI Snapshotter'
65+
body: |
66+
This PR updates SOCI Snapshotter to the latest version
67+
This is an automated update created by the dependency update workflow. Review the changes before approving.
68+
branch: update-soci
69+
delete-branch: true

deps/ecr-cred-helper.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VERSION=0.9.0
2+
AMD64_DIGEST=sha256:dd6bd933e439ddb33b9f005ad5575705a243d4e1e3d286b6c82928bcb70e949a
3+
ARM64_DIGEST=sha256:76aa3bb223d4e64dd4456376334273f27830c8d818efe278ab6ea81cb0844420

deps/soci.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VERSION=0.11.1
2+
AMD64_SHA256_DIGEST=52d72692880150f974a48dbfa44bff01f1a3ba97815658cc16f835e5e7f96d49
3+
ARM64_SHA256_DIGEST=da055b182000dbac3e916a8c731cbc0d7a204791311260c94d960a1160d25b3e

0 commit comments

Comments
 (0)