Skip to content

Commit 12348e8

Browse files
feat: implement codex suggestion
1 parent 62ecf25 commit 12348e8

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

.github/workflows/update_readme.yaml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Update README
22

3+
# This workflow runs AFTER "Deploy Layers" completes successfully.
4+
# No version checking is needed here because:
5+
# 1. Deploy Layers already checks for new versions and skips if none exist
6+
# 2. Deploy Layers updates .tag_version before this workflow runs
7+
# 3. If this workflow is triggered, README should always be updated
8+
39
on:
410
# push:
511
# branches:
@@ -27,12 +33,10 @@ jobs:
2733
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2834
aws-region: us-east-1
2935

30-
- name: Check if update needed
31-
id: check_update
36+
- name: Get Latest Release Info
3237
run: |
3338
JSON_RESPONSE=$(curl -s https://api.github.com/repos/Sparticuz/chromium/releases/latest)
3439
TAG_VERSION=$(echo $JSON_RESPONSE | grep -Po '"tag_name": "\K[^"]+')
35-
CURRENT_VERSION=$(cat .tag_version || echo '')
3640
3741
# Get layer file sizes for both architectures and convert to MB
3842
X64_SIZE_BYTES=$(echo $JSON_RESPONSE | grep -Po '"name": "chromium-[^"]+-layer\.x64\.zip"[^}]*"size": \K[0-9]+' | head -1)
@@ -52,23 +56,9 @@ jobs:
5256
echo "ARM64_SIZE_MB=62" >> $GITHUB_ENV
5357
fi
5458
55-
if [[ "$TAG_VERSION" == "$CURRENT_VERSION" ]]; then
56-
echo "No new version to update. Current: $CURRENT_VERSION, Latest: $TAG_VERSION"
57-
echo "skip=true" >> $GITHUB_OUTPUT
58-
exit 0
59-
fi
60-
61-
echo "New version detected: $TAG_VERSION (current: $CURRENT_VERSION)"
62-
echo "skip=false" >> $GITHUB_OUTPUT
6359
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
6460
65-
- name: Get Latest Release URL and Tag Version
66-
if: steps.check_update.outputs.skip == 'false'
67-
run: |
68-
echo "TAG_VERSION=${{ env.TAG_VERSION }}" >> $GITHUB_ENV
69-
7061
- name: Update README
71-
if: steps.check_update.outputs.skip == 'false'
7262
run: |
7363
TAG_VERSION=${{ env.TAG_VERSION }}
7464
X64_SIZE_MB=${{ env.X64_SIZE_MB }}
@@ -91,7 +81,6 @@ jobs:
9181
done
9282
9383
- name: Commit and Push
94-
if: steps.check_update.outputs.skip == 'false'
9584
run: |
9685
git config --local user.email "action@github.com"
9786
git config --local user.name "GitHub Action"

0 commit comments

Comments
 (0)