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