File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ is specific to GitHub wikis.
116116 links. This helps ensure that the Markdown works in source control as well as
117117 the wiki. The default is true.
118118
119+ - **`disable-empty-commits`:** By default, any triggering of this action will
120+ result in a commit to the Wiki, even if that commit is empty.
121+ If this option is true, a workflow run which would result in no changes
122+ to the Wiki files, will no longer create an empty commit. The default is false.
123+
119124# ### `strategy:` input
120125
121126There are some specific usecases where using `strategy : init` might be better
Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ inputs:
7171 default is true.
7272 required : true
7373 default : true
74+ disable-empty-commits :
75+ description : >-
76+ By default, any triggering of this action will result in a commit to the
77+ Wiki, even if that commit is empty. If this option is true, a workflow
78+ run which would result in no changes to the Wiki files, will no longer
79+ create an empty commit. The default is false.
80+ required : false
81+ default : false
7482outputs :
7583 wiki_url :
7684 description : >-
94102 INPUT_IGNORE : ${{ inputs.ignore }}
95103 INPUT_DRY_RUN : ${{ inputs.dry-run }}
96104 INPUT_PREPROCESS : ${{ inputs.preprocess }}
105+ INPUT_DISABLE_EMPTY_COMMITS : ${{ inputs.disable-empty-commits }}
Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ if (core.getBooleanInput("preprocess")) {
9292}
9393
9494await $ `git add -Av` ;
95- await $ `git commit --allow-empty -m ${ core . getInput ( "commit_message" ) } ` ;
95+ if ( core . getBooleanInput ( "disable_empty_commits" ) ) {
96+ await $ `git commit -m ${ core . getInput ( "commit_message" ) } ` ;
97+ } else {
98+ await $ `git commit --allow-empty -m ${ core . getInput ( "commit_message" ) } ` ;
99+ }
96100
97101if ( core . getBooleanInput ( "dry_run" ) ) {
98102 await $ `git show` ;
You can’t perform that action at this time.
0 commit comments