Skip to content

Commit 505957d

Browse files
Add logic to label PRs as approved on review approval
1 parent 15e3fed commit 505957d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/awesome_workflow.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Awesome CI Workflow
22
on: [push, pull_request]
33
permissions:
44
contents: write
5+
pull_request: write
56

67
jobs:
78
MainSequence:
@@ -44,7 +45,22 @@ jobs:
4445
run: |
4546
git diff DIRECTORY.md
4647
git commit -am "clang-format and clang-tidy fixes for ${GITHUB_SHA::8}" || true
47-
git push origin HEAD:$GITHUB_REF || true
48+
git push origin HEAD:$GITHUB_REF || true
49+
label-on-approval:
50+
name: Label on PR Approval
51+
runs-on: ubuntu-latest
52+
if: github.event_name == 'pull_request' && github.event.action == 'submitted' && github.event.review.state == 'approved'
53+
steps:
54+
- name: Add approved label
55+
uses: actions/github-script@v6
56+
with:
57+
script: |
58+
await github.rest.issues.addLabels({
59+
issue_number: context.issue.number,
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
labels: ['approved']
63+
});
4864
4965
build:
5066
name: Compile checks

0 commit comments

Comments
 (0)