Skip to content

Commit c740774

Browse files
committed
update workflow to ignore reproducilbe updates
1 parent 9c923df commit c740774

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

.github/workflows/automated-updates-to-sam-cli.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
git reset --hard develop
3737
cat <<< "$(jq --arg commit_hash "$APP_TEMPLATES_COMMIT_HASH" --indent 4 '.app_template_repo_commit = $commit_hash' samcli/runtime_config.json)" > samcli/runtime_config.json
3838
git status
39-
git diff --quiet && exit 0 # exit if there is no change
39+
# Ignore reproducible requirements when checking for changes (they are updated separately)
40+
git diff --quiet -- . ':!requirements/reproducible-*.txt' && exit 0 # exit if there is no change
4041
echo "is_hash_changed=1" >> $GITHUB_ENV # set env variable for next step run decision
4142
git add -u
4243
git commit -m "feat: updating app templates repo hash with ($APP_TEMPLATES_COMMIT_HASH)"
@@ -87,7 +88,8 @@ jobs:
8788
sed -i "s/$SAM_T_PRE_VERSION/aws-sam-translator==$SAM_T_CUR_VERSION/g" requirements/base.txt
8889
cp -r ../serverless-application-model/tests/translator/input ./tests/functional/commands/validate/lib/models
8990
git status
90-
git diff --quiet && exit 0 # exit if there is no change
91+
# Ignore reproducible requirements when checking for changes (they are updated separately)
92+
git diff --quiet -- . ':!requirements/reproducible-*.txt' && exit 0 # exit if there is no change
9193
echo "is_new_sam_t=1" >> $GITHUB_ENV # set env variable for next step run decision
9294
git add -u
9395
git commit -m "chore: update aws-sam-translator to $SAM_T_CUR_VERSION"
@@ -137,7 +139,8 @@ jobs:
137139
git reset --hard develop
138140
sed -i "s/$BUILDERS_PRE_VERSION/aws_lambda_builders==$BUILDERS_CUR_VERSION/g" requirements/base.txt
139141
git status
140-
git diff --quiet && exit 0 # exit if there is no change
142+
# Ignore reproducible requirements when checking for changes (they are updated separately)
143+
git diff --quiet -- . ':!requirements/reproducible-*.txt' && exit 0 # exit if there is no change
141144
echo "is_new_lambda_builders=1" >> $GITHUB_ENV # set env variable for next step run decision
142145
git add -u
143146
git commit -m "chore: update aws_lambda_builders to $BUILDERS_CUR_VERSION"

.github/workflows/build.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22+
# Update reproducible requirements before unit test for automated dependency update branches
23+
update-reproducibles:
24+
name: Update Reproducible Requirements
25+
if: >
26+
github.repository_owner == 'aws' &&
27+
(github.head_ref == 'update_app_templates_hash' ||
28+
github.head_ref == 'update_sam_transform_version' ||
29+
github.head_ref == 'update_lambda_builders_version')
30+
permissions:
31+
pull-requests: write
32+
contents: write
33+
uses: ./.github/workflows/update-reproducibles.yml
34+
secrets: inherit
35+
2236
run-workflow:
2337
name: PR Workflow
2438
# If any dependent jobs fails, this WF skips which won't block merging PRs
@@ -45,7 +59,8 @@ jobs:
4559

4660
make-pr:
4761
name: make pr / ${{ matrix.os }} / ${{ matrix.python }}
48-
if: github.repository_owner == 'aws'
62+
needs: update-reproducibles
63+
if: github.repository_owner == 'aws' && always()
4964
runs-on: ${{ matrix.os }}
5065
strategy:
5166
fail-fast: false
@@ -73,7 +88,8 @@ jobs:
7388

7489
validate-schema:
7590
name: Validate JSON schema
76-
if: github.repository_owner == 'aws'
91+
needs: update-reproducibles
92+
if: github.repository_owner == 'aws' && always()
7793
permissions:
7894
pull-requests: write
7995
contents: write
@@ -96,7 +112,8 @@ jobs:
96112
97113
integration-tests:
98114
name: Integ / ${{ matrix.os }} / ${{ matrix.python }} / ${{ matrix.tests_config.name }}
99-
if: github.repository_owner == 'aws'
115+
needs: update-reproducibles
116+
if: github.repository_owner == 'aws' && always()
100117
runs-on: ${{ matrix.os }}
101118
env:
102119
AWS_DEFAULT_REGION: us-east-1
@@ -200,7 +217,8 @@ jobs:
200217

201218
smoke-and-functional-tests:
202219
name: ${{ matrix.tests_config.name }} / ${{ matrix.tests_config.os }} / ${{ matrix.python }}
203-
if: github.repository_owner == 'aws'
220+
needs: update-reproducibles
221+
if: github.repository_owner == 'aws' && always()
204222
runs-on: ${{ matrix.tests_config.os }}
205223
env:
206224
AWS_DEFAULT_REGION: us-east-1
@@ -252,7 +270,8 @@ jobs:
252270

253271
docker-disabled:
254272
name: Docker-disabled Tests / ${{ matrix.os }}
255-
if: github.repository_owner == 'aws'
273+
needs: update-reproducibles
274+
if: github.repository_owner == 'aws' && always()
256275
runs-on: ${{ matrix.os }}
257276
env:
258277
SAM_CLI_DEV: "1"

.github/workflows/update-reproducibles.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,21 @@ on:
88
- requirements/reproducible-linux.txt
99
- requirements/reproducible-mac.txt
1010
- requirements/reproducible-win.txt
11+
workflow_call:
12+
# Allow this workflow to be called from other workflows (e.g., build.yml)
1113

1214
jobs:
1315
update-reqs:
1416
permissions:
1517
pull-requests: write
1618
contents: write
17-
if: github.repository_owner == 'aws'
19+
# Skip for automated dependency update branches - build.yml handles those via workflow_call
20+
if: >
21+
github.repository_owner == 'aws' &&
22+
(github.event_name == 'workflow_call' ||
23+
(github.head_ref != 'update_app_templates_hash' &&
24+
github.head_ref != 'update_sam_transform_version' &&
25+
github.head_ref != 'update_lambda_builders_version'))
1826
runs-on: ubuntu-latest
1927
steps:
2028
- uses: actions/checkout@v6

0 commit comments

Comments
 (0)