Skip to content

Commit d2e4680

Browse files
committed
improvements
1 parent 6b7e689 commit d2e4680

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/project_issue_status.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
jobs:
1616
update-issue-status:
1717
runs-on: ubuntu-latest
18+
permissions:
19+
pull-requests: read
20+
contents: read
1821
concurrency:
1922
group: issue-status-${{ github.event.pull_request.number }}
2023
cancel-in-progress: false
@@ -71,7 +74,7 @@ jobs:
7174
-f owner="${REPO%%/*}" \
7275
-f repo="${REPO##*/}" \
7376
-F pr="$PR_NUMBER" \
74-
--jq '[.data.repository.pullRequest.closingIssuesReferences.nodes[].projectItems.nodes[].fieldValueByName.name]
77+
--jq '[.data.repository.pullRequest.closingIssuesReferences.nodes[].projectItems.nodes[].fieldValueByName.name | strings]
7578
| any((. | gsub("^[^A-Za-z]+"; "")) == "Changes Requested" or
7679
(. | gsub("^[^A-Za-z]+"; "")) == "PR Approved")')
7780
echo "Needs reset: $NEEDS_RESET"
@@ -127,7 +130,7 @@ jobs:
127130
id
128131
project {
129132
id
130-
fields(first:20) {
133+
fields(first:50) {
131134
nodes {
132135
... on ProjectV2SingleSelectField {
133136
id
@@ -148,6 +151,11 @@ jobs:
148151
-f repo="$REPO_NAME" \
149152
-F pr="$PR_NUMBER")
150153
154+
if echo "$ALL_DATA" | jq -e '.errors' > /dev/null 2>&1; then
155+
echo "GraphQL error: $(echo "$ALL_DATA" | jq -r '.errors[0].message')"
156+
exit 1
157+
fi
158+
151159
# One TSV line per item: itemId, projectId, statusFieldId, optionId
152160
# Option names are matched after stripping any leading emoji prefix
153161
ITEMS=$(echo "$ALL_DATA" | jq -r --arg t "$TARGET" '

0 commit comments

Comments
 (0)