Skip to content

Commit

Permalink
fix commit messag'e
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranf committed Sep 18, 2024
1 parent efe2eec commit f472189
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ runs:
- name: Set fields
env:
input_message: ${{ inputs.message }}
commit_message: ${{ github.event.head_commit.message }}
shell: bash
if: always()
id: fields
Expand All @@ -44,11 +45,11 @@ runs:
echo "emoji=large_orange_square" >> $GITHUB_OUTPUT
echo "color=warning" >> $GITHUB_OUTPUT
fi
if [ ! -z '$input_message' ]; then
if [ ! -z $input_message ]; then
message=$input_message
elif [ ! -z '${{ github.event.head_commit.message }}' ]; then
elif [ ! -z $commit_message ]; then
# get commit message from `push` trigger
commit_message=$(echo '${{ github.event.head_commit.message }}' | head -n 1)
commit_message=$(echo '$commit_message' | head -n 1)
message="<https://github.com/${{ inputs.repository }}/commit/${{ github.sha }}|$commit_message>"
elif git rev-parse --is-inside-git-dir > /dev/null 2>&1; then
# get commit message from the current git directory to support `workflow_dispatch` trigger
Expand Down

0 comments on commit f472189

Please sign in to comment.