forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenum-static-mapping-updater.yml
More file actions
64 lines (55 loc) · 2.16 KB
/
enum-static-mapping-updater.yml
File metadata and controls
64 lines (55 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: CDK Enums Static Mapping Updater
on:
workflow_dispatch:
schedule: # Runs every Monday at 12am PT
- cron: '0 0 * * 1'
jobs:
update-l2-enums:
if: github.repository == 'aws/aws-cdk'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check Out
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: "*"
env:
NODE_OPTIONS: "--max-old-space-size=8196 --experimental-worker ${NODE_OPTIONS:-}"
- name: Install dependencies
run: cd tools/@aws-cdk/enum-updater && yarn install --frozen-lockfile && yarn build
- name: Update enum static mapping
run: |
cd tools/@aws-cdk/enum-updater
./bin/update-static-enum-mapping
- name: Check for changes
id: static-mapping-check
run: |
cd tools/@aws-cdk/enum-updater
if [[ -n "$(git status --porcelain ./lib/static-enum-mapping.json)" ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: Create PR for static mapping changes
if: steps.static-mapping-check.outputs.changes == 'true'
run: |
cd tools/@aws-cdk/enum-updater
git config --global user.name 'aws-cdk-automation'
git config --global user.email 'aws-cdk-automation@users.noreply.github.com'
# Create a new branch for the module
branchName="enum-update/static-mapping-update"
git checkout -b "$branchName"
git add . # Add all files changed
git commit -m "chore(enum-updater): update enum static mapping"
git push -f origin "$branchName"
gh pr create --title "chore(enum-updater): update enum static mapping" \
--body "This PR updates the CDK enum mapping file." \
--base main \
--head "$branchName" \
--label "contribution/core,pr-linter/exempt-integ-test,pr-linter/exempt-readme,pr-linter/exempt-test"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}