From 3133022d422f1790cc6104d7f587a4208732ebca Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Mon, 22 Apr 2024 10:34:05 -0700 Subject: [PATCH] Add maintenance jobs for v0 and v1 --- .../{maintenance.yaml => maintenance-v0.yaml} | 6 ++- .github/workflows/maintenance-v1.yaml | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) rename .github/workflows/{maintenance.yaml => maintenance-v0.yaml} (95%) create mode 100644 .github/workflows/maintenance-v1.yaml diff --git a/.github/workflows/maintenance.yaml b/.github/workflows/maintenance-v0.yaml similarity index 95% rename from .github/workflows/maintenance.yaml rename to .github/workflows/maintenance-v0.yaml index 349e7ec869..ff4f1bd1c7 100644 --- a/.github/workflows/maintenance.yaml +++ b/.github/workflows/maintenance-v0.yaml @@ -1,13 +1,15 @@ -name: Automated Maintenance +name: Automated Maintenance v0 on: schedule: - - cron: '0 */2 * * *' + - cron: '0 4,8,16,20 * * *' workflow_dispatch: # Enables on-demand/manual triggering: https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow jobs: job: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: 'main' - uses: actions/setup-python@v5 with: python-version: 3 diff --git a/.github/workflows/maintenance-v1.yaml b/.github/workflows/maintenance-v1.yaml new file mode 100644 index 0000000000..5432cf4e46 --- /dev/null +++ b/.github/workflows/maintenance-v1.yaml @@ -0,0 +1,45 @@ +name: Automated Maintenance v1 +on: + schedule: + - cron: '0 0,6,12,18 * * *' + workflow_dispatch: # Enables on-demand/manual triggering: https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow +jobs: + job: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: 'v1' + - uses: actions/setup-python@v5 + with: + python-version: 3 + - + id: maintenance + run: | + latest_sam_cli=`curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r .tag_name | cut -c 2-` + 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-` + sed -i -E "s/aws-sam-translator>=[0-9.]+/aws-sam-translator>=$latest/" setup.py + pip install -e . + rm -rf src/cfnlint/data/DownloadsMetadata/* + cfn-lint --update-iam-policies + cfn-lint --update-documentation + scripts/update_specs_services_from_ssm.py + scripts/update_specs_from_pricing.py + scripts/update_serverless_aws_policies.py + scripts/update_schemas_from_aws_api.py + cfn-lint --update-specs + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - uses: peter-evans/create-pull-request@v6 + with: + commit-message: | + Update CloudFormation schemas to ${{ steps.maintenance.outputs.date }} + body: | + - Update CloudFormation schemas to ${{ steps.maintenance.outputs.date }} + - Update Specs from pricing data as of ${{ steps.maintenance.outputs.date }} + + Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action + delete-branch: true + title: chore(schemas) - Update CloudFormation schemas to ${{ steps.maintenance.outputs.date }}