Skip to content

Commit 1dab7b1

Browse files
committed
add auto label on merged pr
1 parent 86ce84c commit 1dab7b1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Auto Label PRs
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
label_pr:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- name: Label Merged PR
15+
if: github.event.pull_request.merged == true
16+
uses: actions/github-script@v6
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
script: |
20+
const pr = context.payload.pull_request;
21+
22+
// Add labels to merged pull requests
23+
await github.rest.issues.addLabels({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
issue_number: pr.number,
27+
labels: ['gssoc-ext', 'hacktoberfest-accepted']
28+
});

0 commit comments

Comments
 (0)