-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add team: ide label for new issues (#1091)
- Loading branch information
Showing
1 changed file
with
8 additions
and
51 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 |
---|---|---|
@@ -1,58 +1,15 @@ | ||
name: Issue and PR Triage | ||
name: Issue Triage | ||
on: | ||
pull_request: | ||
types: [opened] | ||
issues: | ||
types: [opened] | ||
jobs: | ||
triage: | ||
name: Triage issue/PR | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add team label | ||
uses: andymckay/[email protected] | ||
with: | ||
add-labels: "team: workspace" | ||
|
||
- name: Get project data | ||
if: github.event_name == 'issues' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.LABELER_TOKEN }} | ||
ORGANIZATION: gitpod-io | ||
PROJECT_NUMBER: 16 | ||
run: | | ||
gh api graphql -f query=' | ||
query($org: String!, $number: Int!) { | ||
organization(login: $org){ | ||
id | ||
projectNext(number: $number) { | ||
id | ||
fields(first:20) { | ||
nodes { | ||
id | ||
name | ||
settings | ||
} | ||
} | ||
} | ||
} | ||
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV | ||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV | ||
echo 'IN_PROGRESS_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV | ||
- name: Add Issue to project | ||
if: github.event_name == 'issues' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.LABELER_TOKEN }} | ||
ISSUE_ID: ${{ github.event.issue.node_id }} | ||
run: | | ||
gh api graphql -f query=' | ||
mutation($project:ID!, $issue:ID!) { | ||
addProjectNextItem(input: {projectId: $project, contentId: $issue}) { | ||
projectNextItem { | ||
id | ||
} | ||
} | ||
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id' | ||
- name: add label | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
labels: "team: ide" |