Skip to content

Commit a6f0cf1

Browse files
authored
Adding an option to specify a custom commit message (#18)
1 parent 12981df commit a6f0cf1

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ See [action.yml](action.yml).
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
with:
2525
26-
build_dir: _site # optional
27-
branch: website # optional
28-
cname: domain.tld # optional
29-
jekyll: no # optional
26+
build_dir: _site # optional
27+
branch: website # optional
28+
cname: domain.tld # optional
29+
jekyll: no # optional
30+
commit_message: custom message # optional
3031
```
3132
3233
**Workflow example:**

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ inputs:
1919
description: '`yes` in case of a Jekyll site.'
2020
required: false
2121
default: 'no'
22+
commit_message:
23+
description: 'A custom commit message.'
24+
required: false
2225
outputs:
2326
result:
2427
description: 'The deploy result'

entrypoint.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ if [ ! -z "$INPUT_CNAME" ]; then
6363
echo "$INPUT_CNAME" > CNAME
6464
fi
6565

66+
# Custom commit message
67+
if [ -z "$INPUT_COMMIT_MESSAGE" ]
68+
then
69+
INPUT_COMMIT_MESSAGE="$GITHUB_ACTOR published a site update"
70+
fi
71+
6672
# .nojekyll
6773
if [ "$INPUT_JEKYLL" != "yes" ]; then
6874
touch .nojekyll
@@ -73,7 +79,7 @@ if [ -z "$(git status --porcelain)" ]; then
7379
result="Nothing to deploy"
7480
else
7581
git add -Af .
76-
git commit -m "$GITHUB_ACTOR published a site update"
82+
git commit -m "$INPUT_COMMIT_MESSAGE"
7783
git push -fq origin $TARGET_BRANCH > /dev/null
7884
# push is OK?
7985
if [ $? = 0 ]

0 commit comments

Comments
 (0)