Skip to content

Commit f3d9f6a

Browse files
committed
chore: update compiled workflows via e2e.sh
1 parent e554a70 commit f3d9f6a

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

e2e.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -518,45 +518,46 @@ create_test_discussion() {
518518
local body="$2"
519519
local category="${3:-General}"
520520

521-
# Get repository ID and category ID using GraphQL
522-
local repo_id=$(gh api graphql -f query='
523-
{
524-
repository(owner: "'$REPO_OWNER'", name: "'$REPO_NAME'") {
521+
# Get repository ID using GraphQL
522+
local repo_query="{
523+
repository(owner: \"$REPO_OWNER\", name: \"$REPO_NAME\") {
525524
id
526525
}
527-
}' --jq '.data.repository.id' 2>/dev/null)
526+
}"
527+
local repo_id=$(gh api graphql -f query="$repo_query" --jq '.data.repository.id' 2>/dev/null)
528528

529-
local category_id=$(gh api graphql -f query='
530-
{
531-
repository(owner: "'$REPO_OWNER'", name: "'$REPO_NAME'") {
529+
# Get category ID using GraphQL
530+
local category_query="{
531+
repository(owner: \"$REPO_OWNER\", name: \"$REPO_NAME\") {
532532
discussionCategories(first: 10) {
533533
nodes {
534534
id
535535
name
536536
}
537537
}
538538
}
539-
}' --jq '.data.repository.discussionCategories.nodes[] | select(.name=="'$category'") | .id' 2>/dev/null)
539+
}"
540+
local category_id=$(gh api graphql -f query="$category_query" --jq ".data.repository.discussionCategories.nodes[] | select(.name==\"$category\") | .id" 2>/dev/null)
540541

541542
if [[ -z "$repo_id" || -z "$category_id" ]]; then
542543
echo ""
543544
return
544545
fi
545546

546547
# Create discussion using GraphQL mutation
547-
local discussion_data=$(gh api graphql -f query='
548-
mutation {
548+
local mutation="mutation {
549549
createDiscussion(input: {
550-
repositoryId: "'$repo_id'"
551-
categoryId: "'$category_id'"
552-
title: "'$title'"
553-
body: "'$body'"
550+
repositoryId: \"$repo_id\"
551+
categoryId: \"$category_id\"
552+
title: \"$title\"
553+
body: \"$body\"
554554
}) {
555555
discussion {
556556
number
557557
}
558558
}
559-
}' --jq '.data.createDiscussion.discussion.number // empty' 2>/dev/null)
559+
}"
560+
local discussion_data=$(gh api graphql -f query="$mutation" --jq '.data.createDiscussion.discussion.number // empty' 2>/dev/null)
560561

561562
if [[ -n "$discussion_data" ]]; then
562563
echo "$discussion_data"

0 commit comments

Comments
 (0)