Skip to content

Commit 869870d

Browse files
authored
Add maintenance jobs for v0 and v1 (#3156)
1 parent d49a967 commit 869870d

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

.github/workflows/maintenance.yaml renamed to .github/workflows/maintenance-v0.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: Automated Maintenance
1+
name: Automated Maintenance v0
22
on:
33
schedule:
4-
- cron: '0 */2 * * *'
4+
- cron: '0 4,8,16,20 * * *'
55
workflow_dispatch: # Enables on-demand/manual triggering: https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
66
jobs:
77
job:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11+
with:
12+
ref: 'main'
1113
- uses: actions/setup-python@v5
1214
with:
1315
python-version: 3
@@ -32,6 +34,7 @@ jobs:
3234
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3335
- uses: peter-evans/create-pull-request@v6
3436
with:
37+
branch: main
3538
commit-message: |
3639
Update CloudFormation specs to ${{ steps.maintenance.outputs.specversion }}
3740
body: |

.github/workflows/maintenance-v1.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Automated Maintenance v1
2+
on:
3+
schedule:
4+
- cron: '0 0,6,12,18 * * *'
5+
workflow_dispatch: # Enables on-demand/manual triggering: https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow
6+
jobs:
7+
job:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: 'v1'
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: 3
16+
-
17+
id: maintenance
18+
run: |
19+
latest_sam_cli=`curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r .tag_name | cut -c 2-`
20+
latest=`curl "https://pypi.org/pypi/aws-sam-cli/$latest_sam_cli/json" -s | jq -r '.info.requires_dist[] | select(contains("aws-sam-translator"))' | cut -c 21-`
21+
sed -i -E "s/aws-sam-translator>=[0-9.]+/aws-sam-translator>=$latest/" setup.py
22+
pip install -e .
23+
rm -rf src/cfnlint/data/DownloadsMetadata/*
24+
cfn-lint --update-iam-policies
25+
cfn-lint --update-documentation
26+
scripts/update_specs_services_from_ssm.py
27+
scripts/update_specs_from_pricing.py
28+
scripts/update_serverless_aws_policies.py
29+
scripts/update_schemas_from_aws_api.py
30+
cfn-lint --update-specs
31+
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
32+
env:
33+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
34+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
35+
- uses: peter-evans/create-pull-request@v6
36+
with:
37+
branch: v1
38+
commit-message: |
39+
Update CloudFormation schemas to ${{ steps.maintenance.outputs.date }}
40+
body: |
41+
- Update CloudFormation schemas to ${{ steps.maintenance.outputs.date }}
42+
- Update Specs from pricing data as of ${{ steps.maintenance.outputs.date }}
43+
44+
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
45+
delete-branch: true
46+
title: chore(schemas) - Update CloudFormation schemas to ${{ steps.maintenance.outputs.date }}

0 commit comments

Comments
 (0)