-
Notifications
You must be signed in to change notification settings - Fork 791
48 lines (43 loc) · 1.62 KB
/
approve-application.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
name: Approve application
on:
issues:
types: [labeled]
jobs:
check:
runs-on: ubuntu-latest
if: vars.PROCESSOR_ENABLED == 'true'
outputs:
is_approved: ${{ steps.check_label.outputs.is_approved }}
approver_id: ${{ steps.check_label.outputs.approver_id }}
approver_username: ${{ steps.check_label.outputs.approver_username }}
steps:
- id: check_label
name: "Check if label is 'status: approved'"
run: |
echo "is_approved=$(echo ${{ github.event.label.name == 'status: approved' }})" >> $GITHUB_OUTPUT
echo "approver_id=${{ github.event.sender.id }}" >> $GITHUB_OUTPUT
echo "approver_username=${{ github.event.sender.login }}" >> $GITHUB_OUTPUT
approve:
needs: check
runs-on: ubuntu-latest
if: vars.PROCESSOR_ENABLED == 'true' && needs.check.outputs.is_approved == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch processor
uses: dsaltares/fetch-gh-release-asset@1.1.1
with:
file: "processor"
target: "./processor"
- name: Automated application approval
run: |
chmod +x ./processor
./processor approve
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
APPROVER_ID: ${{ needs.check.outputs.approver_id }}
APPROVER_USERNAME: ${{ needs.check.outputs.approver_username }}
OP_BOT_PAT: ${{ secrets.OP_BOT_PAT }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
REPOSITORY_NAME: ${{ github.event.repository.name }}