Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/approval-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Approval Check Worker

on:
issue_comment:
types: [created]

jobs:
run-when-command:
if: "github.event.issue.pull_request != null && (contains(github.event.comment.body, '/review') || contains(github.event.comment.body, 'review'))"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
statuses: write

outputs:
number: ${{ steps.pr.outputs.number }}
sha: ${{ steps.pr.outputs.sha }}

steps:
- name: Get latest PR head SHA
id: pr
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = context.payload.issue.number;
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
core.setOutput('number', String(prNumber));
core.setOutput('sha', pr.head.sha);

check-approvals:
needs: run-when-command
if: ${{ always() && needs.run-when-command.result == 'success' }}
permissions:
contents: write
pull-requests: write
statuses: write
issues: write
uses: tetherto/qvac-devops/.github/workflows/approval-check-worker.yml@production-workflows-tag
secrets: inherit
with:
pr_number: ${{ fromJSON(needs.run-when-command.outputs.number) }}
pr_sha: ${{ needs.run-when-command.outputs.sha }}

Loading