Skip to content

PR Approval Label

PR Approval Label #19

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'
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']
});