forked from akinjanata/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.59 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
42
43
44
45
46
47
48
49
50
51
52
53
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
permissions:
contents: read
repository-projects: write
jobs:
move-reopened-issue-to-triage:
if: github.repository == 'github/docs'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0
with:
script: |
const issueNumber = context.issue.number;
const doneColumnId = 11167427;
const triageColumnId = 11007039;
try {
const cards = await github.rest.projects.listCards({
column_id: doneColumnId
});
for (const card of cards) {
if (card.content_url.endsWith(`/${issueNumber}`)) {
await github.rest.projects.moveCard({
card_id: card.id,
position: 'position',
column_id: triageColumnId
});
}
}
} catch(e) {
console.log(e);
}
- name: Check out repo
if: ${{ failure() }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: ./.github/actions/slack-alert
if: ${{ failure() }}
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}