From e3fce7fe638aee5f736c85c0e7229ce9b0085903 Mon Sep 17 00:00:00 2001 From: Alejandro Alvarez Date: Thu, 5 Sep 2024 06:20:43 +0200 Subject: [PATCH] Update package.yml --- .github/workflows/package.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index f2d07298..6d575c60 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -88,9 +88,13 @@ jobs: # Search for open pull requests with the specified title in the Homebrew/homebrew-core repo pr_exists=$(gh pr list --repo Homebrew/homebrew-core --state open --search "$pr_title" --json title --jq ".[] | select(.title == \"$pr_title\") | .title" || true) - echo "pr_exists: $pr_exists" + # Trim any leading/trailing whitespace (if any) from pr_exists + pr_exists=$(echo "$pr_exists" | xargs) + + echo "pr_exists: '$pr_exists'" + # Set the environment variable based on whether the PR exists - if [ -n "$pr_exists" ] && [ "$pr_exists" != "null" ]; then + if [ -n "$pr_exists" ]; then echo "PR_EXISTS=true" >> $GITHUB_ENV else echo "PR_EXISTS=false" >> $GITHUB_ENV