Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 26 additions & 7 deletions .github/workflows/pr-approval-check.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
name: PR Approval Check

on:
pull_request_review:
types: [submitted, dismissed]
pull_request_target:
types: [opened, reopened, synchronize]
workflow_run:
workflows: ["Receive PR"]
types: ["completed"]

permissions:
actions: read

jobs:
approval:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- name: Download artifact from triggering run
uses: actions/download-artifact@v6
with:
run-id: ${{ github.event.workflow_run.id }}
name: prnum
github-token: ${{ github.token }}

- name: Read inputs
id: get-prnum
run: |
set -euo pipefail
echo "prnum=$(cat prnum.txt)" >> "$GITHUB_OUTPUT"

- name: Mint installation token
id: app-token
uses: actions/create-github-app-token@v2
uses: actions/create-github-app-token@v2.1.4
with:
app-id: ${{ secrets.PR_APPROVAL_CHECK_APP_ID }}
private-key: ${{ secrets.PR_APPROVAL_CHECK }}

- name: Require Product Eng approval
uses: trufflesecurity/pr-approval-check@v1
uses: trufflesecurity/pr-approval-check@workflow-triggered
with:
org: trufflesecurity
approver_team: product-eng
owner: ${{ github.event.workflow_run.repository.owner.login }}
repo: ${{ github.event.workflow_run.repository.name }}
head: ${{ github.event.workflow_run.head_sha }}
number: ${{ steps.get-prnum.outputs.prnum }}
github_token: ${{ steps.app-token.outputs.token }}

25 changes: 25 additions & 0 deletions .github/workflows/receive-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Receive PR"

on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
pull_request_review:
types: [submitted, edited, dismissed]

jobs:
prnum:
runs-on: ubuntu-slim
steps:
- name: Determine PR Number
id: build
run: |
echo "PR: ${{ github.event.pull_request.number }}"
echo "${{ github.event.pull_request.number }}" > prnum.txt

- name: Submit
uses: actions/upload-artifact@v5
with:
name: prnum
path: prnum.txt
retention-days: 1

Loading