Skip to content

Commit

Permalink
fix: grep shouldn't trigger not found return code error
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Tautenhahn <stevie-@users.noreply.github.com>
  • Loading branch information
stevie- committed Feb 6, 2024
1 parent d92a53a commit 18dbd9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ runs:
INPUT_PR_DRAFT: ${{ inputs.pr_draft }}
INPUT_PR_ALLOW_EMPTY: ${{ inputs.pr_allow_empty }}
id: pr-creation
shell: bash
run: |
set -e
set -o pipefail
Expand Down Expand Up @@ -222,10 +223,10 @@ runs:
set +e
catch pr_command_output pr_command_error "${COMMAND[@]}"
pr_command_exit_code=$?
pr_already_exists=$(echo "${pr_command_error}" | grep -c "already exists:" || true)
set -e
echo_info "Output of github cli command: " ${pr_command_output} ${pr_command_error}
pr_already_exists=$(echo "${pr_command_error}" | grep -c "already exists:")
if [[ "$pr_command_exit_code" -eq 0 ]];
then
pr_url="${pr_command_output}"
Expand All @@ -252,11 +253,10 @@ runs:
echo "pr_url=$pr_url" >> "$GITHUB_OUTPUT"
echo "pr_number=$pr_number" >> "$GITHUB_OUTPUT"
echo "has_changed_files=${has_changed_files}" >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
cat "$GITHUB_OUTPUT"
echo "::endgroup::"
shell: bash
branding:
icon: 'git-pull-request'
Expand Down

0 comments on commit 18dbd9e

Please sign in to comment.