1
+ name : round-robin
2
+ permissions :
3
+ issues : write
4
+
5
+ on :
6
+ issues :
7
+ types : [opened]
8
+
9
+ jobs :
10
+ assignIssue :
11
+ name : Assign Issue to Someone
12
+ runs-on : ubuntu-latest
13
+ if : github.repository == 'microsoft/debugpy && github.event.action == 'opened' && !contains( github.event.issue.labels.*.name, 'skip-reassign')
14
+ steps :
15
+ - name : Find last assigned
16
+ id : assigned
17
+ uses : actions/github-script@v6.3.3
18
+ with :
19
+ github-token : ${{secrets.GITHUB_TOKEN}}
20
+ result-encoding : string
21
+ script : |
22
+ const issue = await github.rest.issues.get({
23
+ issue_number: 1649,
24
+ owner: context.repo.owner,
25
+ repo: context.repo.repo
26
+ });
27
+ return issue.data.assignees[0].login || '';
28
+ - name : Dump last assigned
29
+ env :
30
+ LAST_ASSIGNED : ${{ steps.assigned.outputs.result }}
31
+ run : echo "$LAST_ASSIGNED"
32
+ - uses : lee-dohm/team-rotation@v1
33
+ with :
34
+ last : ${{ steps.assigned.outputs.result }}
35
+ include : AdamYoblick bschnurr debonte heejaechang StellaHuang95 rchiodo KacieKK judej
36
+ id : rotation
37
+ - name : Dump next in rotation
38
+ env :
39
+ NEXT_ROTATION : ${{ steps.rotation.outputs.next }}
40
+ run : echo "$NEXT_ROTATION"
41
+ - name : Assign to next person
42
+ uses : actions/github-script@v6.3.3
43
+ with :
44
+ github-token : ${{secrets.GITHUB_TOKEN}}
45
+ script : |
46
+ github.rest.issues.addAssignees({
47
+ issue_number: context.issue.number,
48
+ owner: context.repo.owner,
49
+ repo: context.repo.repo,
50
+ assignees: ['${{ steps.rotation.outputs.next }}']
51
+ })
52
+ - name : Give it the label 'needs repro'
53
+ uses : actions/github-script@v6.3.3
54
+ with :
55
+ github-token : ${{secrets.GITHUB_TOKEN}}
56
+ script : |
57
+ github.rest.issues.addLabels({
58
+ issue_number: context.issue.number,
59
+ owner: context.repo.owner,
60
+ repo: context.repo.repo,
61
+ labels: ['needs repro']
62
+ })
63
+ - name : Save assignment to state
64
+ uses : actions/github-script@v6.3.3
65
+ with :
66
+ github-token : ${{secrets.GITHUB_TOKEN}}
67
+ script : |
68
+ await github.rest.issues.removeAssignees({
69
+ issue_number: 1649,
70
+ owner: context.repo.owner,
71
+ repo: context.repo.repo,
72
+ assignees: ['${{ steps.assigned.outputs.result }}']
73
+ });
74
+ github.rest.issues.addAssignees({
75
+ issue_number: 1649,
76
+ owner: context.repo.owner,
77
+ repo: context.repo.repo,
78
+ assignees: ['${{ steps.rotation.outputs.next }}']
79
+ })
0 commit comments