We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bd39a3e + 3e6314b commit 87fd5d5Copy full SHA for 87fd5d5
1 file changed
.github/workflows/assign-pr-author-on-merge.yml
@@ -0,0 +1,33 @@
1
+name: Assign PR author on merge
2
+
3
+on:
4
+ pull_request_target:
5
+ types: [closed]
6
7
+permissions:
8
+ pull-requests: write
9
10
+jobs:
11
+ assign-author:
12
+ runs-on: ubuntu-latest
13
+ if: github.event.pull_request.merged == true
14
15
+ steps:
16
+ - name: Assign PR to its author
17
+ uses: actions/github-script@v7
18
+ with:
19
+ script: |
20
+ const pr = context.payload.pull_request;
21
22
+ // Get the PR author's username
23
+ const author = pr.user.login;
24
25
+ // Assign PR to the author
26
+ await github.rest.issues.addAssignees({
27
+ owner: context.repo.owner,
28
+ repo: context.repo.repo,
29
+ issue_number: pr.number,
30
+ assignees: [author],
31
+ });
32
33
+ console.log(`PR #${pr.number} assigned to @${author}`);
0 commit comments