Skip to content

Commit

Permalink
Merge pull request #12 from yumemi-inc/change_comment_input
Browse files Browse the repository at this point in the history
Allow comment input not set
  • Loading branch information
hkusu authored Sep 5, 2024
2 parents 1c7c133 + 7094e14 commit 83a841f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branding:
inputs:
comment:
description: 'Comment text.'
required: true
required: false
comment-if-failure:
description: 'Comment text to be used with priority when job status is failure. If not specified, normal comment will be used.'
required: false
Expand Down Expand Up @@ -50,8 +50,6 @@ runs:
echo "::debug::jq version: $(jq --version)"
source "$GITHUB_ACTION_PATH/raise_error.sh"
if [ -z "$COMMENT" ]; then raise_error "Specify 'comment' or 'failure-comment' input."; fi
if [ "$IS_VALID_PREVIOUS_COMMENT" != 'true' ]; then raise_error "'previous-comment' input must be one of delete, hide, edit, or keep."; fi
# have pemisson?
Expand Down Expand Up @@ -100,6 +98,8 @@ runs:
done
fi
if [ -z "$COMMENT" ]; then exit 0; fi
comment="$(echo -e "<!-- $TAG -->\n\n$COMMENT")"
if [[ "$PREVIOUS_COMMENT" == 'edit' && -n "$ids" ]]; then
Expand All @@ -112,5 +112,5 @@ runs:
if: inputs.fail == 'true'
shell: bash
env:
COMMENT: ${{ job.status == 'failure' && inputs.comment-if-failure || inputs.comment }}
COMMENT: ${{ job.status == 'failure' && inputs.comment-if-failure || inputs.comment || 'unknown' }}
run: echo "::error::$COMMENT" && exit 1

0 comments on commit 83a841f

Please sign in to comment.