|
1 | 1 | name: CDK Enums Auto Updater
|
2 | 2 | on:
|
3 | 3 | workflow_dispatch:
|
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * 1' |
4 | 6 |
|
5 | 7 | jobs:
|
6 | 8 | update-l2-enums:
|
|
23 | 25 | - name: Install dependencies
|
24 | 26 | run: cd tools/@aws-cdk/enum-updater && yarn install --frozen-lockfile && yarn build
|
25 | 27 |
|
| 28 | + - name: Update enum static mapping |
| 29 | + run: | |
| 30 | + cd tools/@aws-cdk/enum-updater |
| 31 | + ./bin/update-static-enum-mapping |
| 32 | +
|
| 33 | + - name: Check for changes |
| 34 | + id: static-mapping-check |
| 35 | + run: | |
| 36 | + if [[ -n "$(git status --porcelain ./lib/static-enum-mapping.json)" ]]; then |
| 37 | + echo "changes=true" >> $GITHUB_OUTPUT |
| 38 | + else |
| 39 | + echo "changes=false" >> $GITHUB_OUTPUT |
| 40 | + fi |
| 41 | + |
| 42 | + - name: Create PR for static mapping changes |
| 43 | + if: steps.static-mapping-check.outputs.changes == 'true' |
| 44 | + run: | |
| 45 | + git config --global user.name 'aws-cdk-automation' |
| 46 | + git config --global user.email '[email protected]' |
| 47 | +
|
| 48 | + # Create a new branch for the module |
| 49 | + branchName="enum-update/static-mapping-update" |
| 50 | + git checkout -b "$branchName" |
| 51 | +
|
| 52 | + git add . # Add all files changed |
| 53 | + git commit -m "chore: update enum static mapping" |
| 54 | + git push origin "$branchName" |
| 55 | +
|
| 56 | + gh pr create --title "chore: update enum static mapping" \ |
| 57 | + --body "This PR updates the CDK enum mapping file." \ |
| 58 | + --base main \ |
| 59 | + --head "$branchName" |
| 60 | + --label "contribution/core,pr-linter/exempt-integ-test,pr-linter/exempt-readme,pr-linter/exempt-test" |
| 61 | +
|
26 | 62 | - name: Identify Missing Values and Apply Code Changes
|
27 | 63 | run: |
|
28 | 64 | cd tools/@aws-cdk/enum-updater
|
|
40 | 76 | - name: Commit & Push changes
|
41 | 77 | if: steps.git-check.outputs.changes == 'true'
|
42 | 78 | run: |
|
43 |
| - git config --global user.name 'aws-cdk-automation' |
44 |
| - git config --global user.email '[email protected]' |
45 |
| - |
46 | 79 | # Iterate through each module directory that has changes
|
47 | 80 | for module in $(git diff --name-only | grep -E '^packages/(@aws-cdk|aws-cdk-lib)/.*' | sed -E 's|^packages/(@aws-cdk\|aws-cdk-lib)/([^/]+).*|\2|' | sort -u); do
|
48 | 81 | moduleName=$(basename $module)
|
|
0 commit comments