forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request github#18653 from github/add-issue-reopen-project-…
…workflow Add move reopened issues to triage column workflow
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |