8000 Update pr.yaml · github/CodeSearchNet@83b0994 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.

Commit 83b0994

Browse files
author
Hamel Husain
authored
Update pr.yaml
add rand assignee
1 parent e41004c commit 83b0994

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/pr.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,26 @@ jobs:
2727
USER: ${{ github.event.pull_request.user.login }}
2828
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Choose Reviewer Randomly
32+
run: |
33+
import random
34+
asignee = random.choice(['hamelsmu', 'hohsiangwu', 'mallamanis', 'mmjb'])
35+
print("::set-env name=ASIGNEE::{}".format(reviewer))
36+
shell: python
37+
38+
- name: Make assignment
39+
run: |
40+
URI=https://api.github.com
41+
API_VERSION=v3
42+
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
43+
AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}"
44+
# Add assignee with APIv3 # POST /repos/:owner/:repo/issues/:issue_number/assignees
45+
curl -XPOST -sSL \
46+
-d "{\"assignees\": [\"${ASIGNEE}\"]}" \
47+
-H "${AUTH_HEADER}" \
48+
-H "${API_HEADER}" \
49+
"${URI}/repos/${GITHUB_REPOSITORY}/issues/${ISSUE_NUMBER}/assignees"
50+
env:
51+
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)
0