ci(deps): Bump actions/checkout from 3.6.0 to 4.0.0 (#266) #7
This file contains 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
# Repository Infrastructure Management | |
# | |
# Update repository infrastructure on `push` or `workflow_dispatch` when the infrastructure config | |
# file (or this workflow) is updated. The user triggering the workflow run (`github.actor`) must be | |
# a repository admin. | |
# | |
# Note: The permissions of `github.actor` is checked because workflow re-runs will reuse the | |
# privileges of `github.actor` even if the actor initiating the re-run (`github.triggering_actor`) | |
# has different privileges. | |
# | |
# References: | |
# | |
# - https://docs.github.com/actions/learn-github-actions/contexts | |
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#push | |
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#push | |
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch | |
# - https://github.com/actions-cool/check-user-permission | |
# - https://github.com/actions/checkout | |
# - https://github.com/flex-development/rice-action | |
# - https://github.com/hmarr/debug-action | |
--- | |
name: infrastructure | |
on: | |
push: | |
branches: | |
- main | |
- release/** | |
paths: | |
- .github/infrastructure.yml | |
- .github/workflows/infrastructure.yml | |
workflow_dispatch: | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
infrastructure: | |
runs-on: ubuntu-latest | |
steps: | |
- id: debug | |
name: Print environment variables and event payload | |
uses: hmarr/[email protected] | |
- id: check-actor-permission | |
name: Check @${{ github.actor }} permission level | |
uses: actions-cool/[email protected] | |
with: | |
require: admin | |
username: ${{ github.actor }} | |
- id: checkout | |
name: Checkout ${{ github.ref_name }} | |
uses: actions/[email protected] | |
with: | |
persist-credentials: false | |
ref: ${{ github.ref }} | |
- id: update | |
if: steps.check-actor-permission.outputs.require-result == 'true' | |
name: Update repository infrastructure | |
uses: flex-development/[email protected] | |
with: | |
token: ${{ secrets.PAT_REPO }} |