File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed
Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ Add the following step at the end of your job.
1818 commit_message : Apply automatic changes
1919 branch : ${{ github.head_ref }}
2020
21+ # Optional git params
22+ commit_options : ' --no-verify --signoff'
23+
2124 # Optional glob pattern of files which should be added to the commit
2225 file_pattern : src/\*.js
2326 env :
Original file line number Diff line number Diff line change 77 commit_message :
88 description : Commit message
99 required : true
10+ commit_options :
11+ description : Commit options
12+ required : false
1013 branch :
1114 description : Branch where changes should be pushed too
1215 required : true
@@ -18,6 +21,11 @@ inputs:
1821runs :
1922 using : ' docker'
2023 image : ' Dockerfile'
24+ args :
25+ - ${{ inputs.commit_message }}
26+ - ${{ inputs.commit_options }}
27+ - ${{ inputs.branch }}
28+ - ${{ inputs.file_pattern }}
2129
2230branding :
2331 icon : ' git-commit'
Original file line number Diff line number Diff line change 11#! /bin/sh
2+
23set -eu
34
45# Set up .netrc file with GitHub credentials
1819 git config --global user.name " GitHub Actions"
1920}
2021
21-
2222# This section only runs if there have been file changes
2323echo " Checking for uncommitted changes in the git working tree."
2424if ! git diff --quiet
3030 # Switch to branch from current Workflow run
3131 git checkout $INPUT_BRANCH
3232
33- if [ -z ${INPUT_FILE_PATTERN+x} ];
34- then
35- git add .
36- else
37- echo " INPUT_FILE_PATTERN value: $INPUT_FILE_PATTERN " ;
38- git add $INPUT_FILE_PATTERN
39- fi
33+ echo " INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN} "
34+
35+ git add " ${INPUT_FILE_PATTERN} "
36+
37+ echo " INPUT_COMMIT_OPTIONS: ${INPUT_COMMIT_OPTIONS} "
4038
41- git commit -m " $INPUT_COMMIT_MESSAGE " --author=" $GITHUB_ACTOR <$GITHUB_ACTOR @users.noreply.github.com>"
39+ git commit -m " $INPUT_COMMIT_MESSAGE " --author=" $GITHUB_ACTOR <$GITHUB_ACTOR @users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS : + " $INPUT_COMMIT_OPTIONS " }
4240
4341 git push --set-upstream origin " HEAD:$INPUT_BRANCH "
4442else
You can’t perform that action at this time.
0 commit comments