Skip to content
Merged
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
27 changes: 27 additions & 0 deletions .github/workflows/pr-approval-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "PR Approval Label"

on:
pull_request_review:
types: [submitted]

permissions:
contents: read
pull-requests: write

jobs:
add-ready-label:
runs-on: ubuntu-latest
# Only run when an org member approves
if: github.event.review.state == 'approved' && github.event.review.author_association == 'MEMBER'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should tweak this to say, when PR state is "open"

steps:
- name: Add ready label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['ready']
});