forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (36 loc) · 1.22 KB
/
move-reopened-issues-to-triage.yaml
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
name: Move Reopened Issues to Triage
# **What it does**: Moves issues that are reopened from the Done column to the Triage column.
# **Why we have it**: To prevent having to do this manually.
# **Who does it impact**: Open-source.
on:
issues:
types:
- reopened
jobs:
move-reopened-issue-to-triage:
if: github.repository == 'github/docs'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
with:
github-token: ${{ github.token }}
script: |
const issueNumber = context.issue.number;
const doneColumnId = 11167427;
const triageColumnId = 11007039;
try {
const cards = await github.projects.listCards({
column_id: doneColumnId
});
for (const card of cards) {
if (card.content_url.endsWith(`/${issueNumber}`)) {
await github.projects.moveCard({
card_id: card.id,
position: 'position',
column_id: triageColumnId
});
}
}
} catch(e) {
console.log(error);
}