diff --git a/run.sh b/run.sh index 5bf1d3e..4b42575 100755 --- a/run.sh +++ b/run.sh @@ -3,10 +3,10 @@ set -euxo pipefail if [ $GITHUB_EVENT_NAME = check_run ] then if [ -z "$RELEASE_DRAFT_BODY" ]; then - RESULT=$(gh api /repos/$GITHUB_REPOSITORY/releases | jq -e -r '.[] | select(.draft == true and .name == "next") | .body' | egrep "$INTERESTING_CATEGORIES" || echo 'failed') - else - RESULT=$(echo "$RELEASE_DRAFT_BODY" | egrep "$INTERESTING_CATEGORIES" || echo 'failed') + RELEASE_DRAFT_BODY="$(gh api /repos/$GITHUB_REPOSITORY/releases | jq -e -r '.[] | select(.draft == true and .name == "next") | .body')" fi + + RESULT=$(echo "$RELEASE_DRAFT_BODY" | egrep "$INTERESTING_CATEGORIES" || echo 'failed') if [[ $RESULT != 'failed' ]]; then echo "::set-output name=interesting::true" else