Skip to content

Commit c97e795

Browse files
Merge pull request #35227 from hashicorp/move-regressions-to-top
Update workflows to move regressions to the top of the working board
2 parents 449ba0f + b644f71 commit c97e795

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

.github/workflows/issues.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,29 @@ jobs:
103103
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.STATUS_FIELD_ID }} --single-select-option-id ${{ vars.team_project_status_in_progress }}
104104
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_working_board }}
105105
106-
- name: 'Labeled Prioritized or Regression'
107-
if: contains(fromJSON('["prioritized", "regression"]'), github.event.label.name)
106+
- name: 'Labeled Prioritized'
107+
if: github.event.label.name == 'prioritized'
108108
env:
109109
GH_TOKEN: ${{ steps.token.outputs.token }}
110110
run: |
111111
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
112112
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_working_board }}
113113
114+
- name: 'Labeled Regression'
115+
if: github.event.label.name == 'regression'
116+
env:
117+
GH_TOKEN: ${{ steps.token.outputs.token }}
118+
run: |
119+
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
120+
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_working_board }}
121+
122+
gh api graphql -F itemId="$PROJECT_ITEM_ID" -F projectId=${{ env.PROJECT_ID }} -f query='
123+
mutation($itemId:ID!, $projectId:ID!) {
124+
updateProjectV2ItemPosition(input:{itemId:$itemId, projectId:$projectId}) {
125+
clientMutationId
126+
}
127+
}'
128+
114129
- name: 'Labeled Engineering Initiative'
115130
if: github.event.label.name == 'engineering-initiative'
116131
env:

.github/workflows/pull_request_target.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,29 @@ jobs:
165165
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
166166
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_external_maintainer }}
167167
168-
- name: 'Labeled Prioritized or Regression'
169-
if: contains(fromJSON('["prioritized", "regression"]'), github.event.label.name)
168+
- name: 'Labeled Prioritized'
169+
if: github.event.label.name == 'prioritized'
170170
env:
171171
GH_TOKEN: ${{ steps.token.outputs.token }}
172172
run: |
173173
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
174174
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_working_board }}
175175
176+
- name: 'Labeled Regression'
177+
if: github.event.label.name == 'regression'
178+
env:
179+
GH_TOKEN: ${{ steps.token.outputs.token }}
180+
run: |
181+
PROJECT_ITEM_ID=$(gh project item-add ${{ env.PROJECT_NUMBER }} --owner "hashicorp" --url ${{ env.ITEM_URL }} --format json | jq '.id')
182+
gh project item-edit --id "$PROJECT_ITEM_ID" --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.VIEW_FIELD_ID }} --single-select-option-id ${{ vars.team_project_view_working_board }}
183+
184+
gh api graphql -F itemId="$PROJECT_ITEM_ID" -F projectId=${{ env.PROJECT_ID }} -f query='
185+
mutation($itemId:ID!, $projectId:ID!) {
186+
updateProjectV2ItemPosition(input:{itemId:$itemId, projectId:$projectId}) {
187+
clientMutationId
188+
}
189+
}'
190+
176191
- name: 'Labeled Engineering Initiative'
177192
if: github.event.label.name == 'engineering-initiative'
178193
env:

0 commit comments

Comments
 (0)