Update Action Allowlists #42
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 Action Allowlists | |
| on: | |
| schedule: | |
| # Run every Friday at 8:00 AM UTC | |
| - cron: '0 8 * * 5' | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-allowlists: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Generate GitHub App Token | |
| id: generate-token | |
| uses: actions/create-github-app-token@v3.1.1 | |
| with: | |
| client-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| owner: skills | |
| - name: Update allowlists | |
| uses: actions/github-script@v9.0.0 | |
| env: | |
| STRICT_ALLOWLIST_PATH: actions-allowlist/strict.txt | |
| SIMPLE_ALLOWLIST_PATH: actions-allowlist/simple.txt | |
| with: | |
| github-token: ${{ steps.generate-token.outputs.token }} | |
| script: | | |
| const { updateAllowlists } = require('./.github/actions/update-allowlist/main.js'); | |
| await updateAllowlists(github); | |
| - name: Create Pull Request | |
| id: create-pr | |
| uses: peter-evans/create-pull-request@v8.1.1 | |
| with: | |
| branch: update-allowlists | |
| delete-branch: true | |
| commit-message: 'Update action allowlists' | |
| reviewers: FidelusAleksander | |
| title: 'Update Action Allowlists' | |
| body: | | |
| ## Automated Allowlist Update | |
| This PR updates the action allowlists with the latest list of GitHub Actions required to run all GitHub Skills exercises. | |
| - name: Enable auto-merge (squash) | |
| if: steps.create-pr.outputs.pull-request-number | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} --squash --auto | |