Skip to content

Commit

Permalink
Add exit for no issues found and log issues before mutating state
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed May 3, 2024
1 parent 07d8e5e commit ab06f04
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/transfer-issues.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ if [[ -n "$ISSUE_NUMBER" ]]; then
issue(number: $ISSUE_NUMBER) {
id
body
url
}
}
}
Expand All @@ -73,6 +74,7 @@ else
nodes {
id
body
url
}
}
}
Expand All @@ -82,6 +84,14 @@ else
issues=$(gh api graphql -f query="$issues_query" --jq '.data.repository.issues.nodes[]')
fi

if [[ -z "$issues" ]]; then
echo "No issues found. Exiting..."
exit 1
fi

# echo each issue .url property
echo "$issues" | jq -r '.url'

transfer_mutation="mutation {"
comment_mutation="mutation {"

Expand Down

0 comments on commit ab06f04

Please sign in to comment.