-
Notifications
You must be signed in to change notification settings - Fork 2.4k
45 lines (38 loc) · 1.51 KB
/
schema.yml
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
name: Update schema
on:
workflow_dispatch:
schedule:
- cron: "0 16 * * 2" # Every Tuesday at 4pm UTC (8am PST, 9am PDT)
jobs:
update:
if: github.repository == 'aws/serverless-application-model'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Update schema
id: schema
run: |
make init
make schema-all
# Sets condition steps.schema.outputs.changed to true if anything changed
git diff --exit-code || echo "changed=true" >> $GITHUB_OUTPUT
- name: Push change to temporary branch
if: steps.schema.outputs.changed
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git checkout -b tmp/schema/$GITHUB_RUN_ID/$GITHUB_RUN_ATTEMPT
git add -u
git commit -m "chore(schema): update"
git push --set-upstream origin tmp/schema/$GITHUB_RUN_ID/$GITHUB_RUN_ATTEMPT
- name: Create PR
if: steps.schema.outputs.changed
run: printf '> **Note**\n> If checks do not start, close then reopen this pull request.\n\nCreated by the [`schema.yml`](https://github.com/aws/serverless-application-model/blob/develop/.github/workflows/schema.yml) workflow.\n' | gh pr create --fill --base develop --body-file -
env:
GH_TOKEN: ${{ github.token }}