Skip to content

Commit

Permalink
Merge pull request github#18653 from github/add-issue-reopen-project-…
Browse files Browse the repository at this point in the history
…workflow

Add move reopened issues to triage column workflow
  • Loading branch information
lee-dohm authored Apr 8, 2021
2 parents 3f70744 + 35b2897 commit 9b3eb7d
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/move-reopened-issues-to-triage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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@626af12fe9a53dc2972b48385e7fe7dec79145c9
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);
}

0 comments on commit 9b3eb7d

Please sign in to comment.