Skip to content

Commit

Permalink
Add workflow to approve and merge data from applications
Browse files Browse the repository at this point in the history
  • Loading branch information
jodyheavener committed Mar 26, 2024
1 parent 945cb22 commit cb2c5d3
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/approve-application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Approve application

on:
issues:
types: [labeled]

jobs:
check:
runs-on: ubuntu-latest
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: needs.check.outputs.is_approved == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Fetch processor
uses: dsaltares/[email protected]
with:
file: "processor"
target: "./processor"

- name: Automated application approval
run: |
chmod +x ./processor
./processor approve
env:
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 }}

0 comments on commit cb2c5d3

Please sign in to comment.