Skip to content

Commit 2ab0c05

Browse files
authored
Merge pull request #13528 from ethereum/gh-triage-actions
Move new issues to triage
2 parents 16c4c75 + 43e8f7e commit 2ab0c05

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/triage.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Add new issues to triage column
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
env:
9+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
ORGANIZATION: ethereum
11+
REPOSITORY: solidity
12+
PROJECT_NUMBER: 43
13+
DRY_RUN: true
14+
15+
jobs:
16+
triage_issues:
17+
runs-on: ubuntu-latest
18+
if: join(github.event.issue.labels) == ''
19+
steps:
20+
- name: Retrieve the content of all columns on the board
21+
run: |
22+
gh api graphql \
23+
--raw-field owner="$ORGANIZATION" \
24+
--field project_number="$PROJECT_NUMBER" \
25+
--raw-field repository_name="$REPOSITORY" \
26+
--raw-field query='
27+
query($owner: String!, $repository_name: String!, $project_number: Int!) {
28+
repository(owner: $owner, name: $repository_name) {
29+
project(number: $project_number) {
30+
columns(first: 10) {
31+
nodes {
32+
id,
33+
name
34+
}
35+
}
36+
}
37+
}
38+
}' > project_columns.json
39+
echo 'COLUMN_ID='$(jq '.data.repository.project.columns.nodes[] | select(.name == "Triage") | .id' project_columns.json) >> $GITHUB_ENV
40+
echo 'COLUMN_NAME='$(jq '.data.repository.project.columns.nodes[] | select(.name == "Triage") | .name' project_columns.json) >> $GITHUB_ENV
41+
42+
- name: Add issue#${{ github.event.issue.number }} to Triage column
43+
env:
44+
ISSUE_ID: ${{ github.event.issue.node_id }}
45+
run: |
46+
echo "Adding issue: ${{ github.event.issue.number }} to column $COLUMN_NAME in project $PROJECT_NUMBER"
47+
if [[ $DRY_RUN == "false" ]]; then
48+
gh api graphql \
49+
--silent \
50+
--raw-field column=$COLUMN_ID \
51+
--raw-field issue=$ISSUE_ID \
52+
--raw-field query='
53+
mutation($column: ID!, $issue: ID!) {
54+
addProjectCard(input: {
55+
projectColumnId: $column,
56+
contentId: $issue
57+
}) {
58+
clientMutationId
59+
}
60+
}'
61+
fi

0 commit comments

Comments
 (0)