Update AWS CDK libraries #83
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update AWS CDK libraries | |
| on: | |
| schedule: | |
| # At 10:00 on day-of-month 10. | |
| # See https://crontab.guru/#0_10_10_*_* | |
| - cron: '0 10 10 * *' | |
| # Allows one to update the version of AWS CDK by simply starting the workflow, as opposed to manually running the update-aws-cdk script. | |
| workflow_dispatch: | |
| jobs: | |
| update-aws-cdk: | |
| # See https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | |
| permissions: | |
| contents: write # Allow pushing of a branch | |
| pull-requests: write # Allow raising of a PR | |
| runs-on: ubuntu-latest | |
| name: Bump CDK versions | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: main | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: npm | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.PRIVATE_KEY }} | |
| - name: Get GitHub App User ID | |
| id: get-user-id | |
| run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Configure git | |
| run: | | |
| git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' | |
| git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com' | |
| - name: "AWS CDK update" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: ./script/update-aws-cdk |