Skip to content

Commit 9470b50

Browse files
authored
fix(ci): replace heredoc with quoted strings in thread-gate job (#246)
- Heredoc content at column 0 broke YAML literal block scalar parsing - All push events on ci-cd.yml failed since #243 - GraphQL queries now use single-quoted bash strings with proper indentation Fixes #245
1 parent b975845 commit 9470b50

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

.github/workflows/ci-cd.yml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,16 @@ jobs:
136136
while [ "$PAGE_COUNT" -lt "$MAX_PAGES" ]; do
137137
PAGE_COUNT=$((PAGE_COUNT + 1))
138138
if [ -z "$AFTER" ]; then
139-
QUERY=$(cat <<'EOF'
140-
query($owner:String!, $name:String!, $number:Int!) {
141-
repository(owner:$owner, name:$name) {
142-
pullRequest(number:$number) {
143-
reviewThreads(first:100) {
144-
nodes { isResolved, isOutdated }
145-
pageInfo { hasNextPage, endCursor }
146-
}
147-
}
148-
}
149-
}
150-
EOF
151-
)
139+
QUERY='query($owner:String!, $name:String!, $number:Int!) {
140+
repository(owner:$owner, name:$name) {
141+
pullRequest(number:$number) {
142+
reviewThreads(first:100) {
143+
nodes { isResolved, isOutdated }
144+
pageInfo { hasNextPage, endCursor }
145+
}
146+
}
147+
}
148+
}'
152149
RESP=$(gh api graphql \
153150
-f query="$QUERY" \
154151
-f owner="$OWNER" \
@@ -160,19 +157,16 @@ EOF
160157
exit 0
161158
}
162159
else
163-
QUERY_AFTER=$(cat <<'EOF'
164-
query($owner:String!, $name:String!, $number:Int!, $after:String) {
165-
repository(owner:$owner, name:$name) {
166-
pullRequest(number:$number) {
167-
reviewThreads(first:100, after:$after) {
168-
nodes { isResolved, isOutdated }
169-
pageInfo { hasNextPage, endCursor }
170-
}
171-
}
172-
}
173-
}
174-
EOF
175-
)
160+
QUERY_AFTER='query($owner:String!, $name:String!, $number:Int!, $after:String) {
161+
repository(owner:$owner, name:$name) {
162+
pullRequest(number:$number) {
163+
reviewThreads(first:100, after:$after) {
164+
nodes { isResolved, isOutdated }
165+
pageInfo { hasNextPage, endCursor }
166+
}
167+
}
168+
}
169+
}'
176170
RESP=$(gh api graphql \
177171
-f query="$QUERY_AFTER" \
178172
-f owner="$OWNER" \

0 commit comments

Comments
 (0)