-
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (62 loc) · 2.33 KB
/
infrastructure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# 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/learn-github-actions/expressions
# - 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/checkout
# - https://github.com/actions/create-github-app-token
# - https://github.com/flex-development/repostructure-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:
if: contains(vars.MAINTAINERS, github.actor)
runs-on: ubuntu-latest
steps:
- id: debug
name: Print environment variables and event payload
uses: hmarr/[email protected]
- id: bot-token
name: Get bot token
uses: actions/[email protected]
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- id: checkout
name: Checkout ${{ github.ref_name }}@${{ github.sha }}
uses: actions/[email protected]
with:
persist-credentials: false
ref: ${{ github.sha }}
token: ${{ steps.bot-token.outputs.token }}
- id: update
name: Update repository infrastructure
uses: flex-development/[email protected]
with:
token: ${{ steps.bot-token.outputs.token }}