File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ function main() {
5151 args . push ( "--branch-from" , branchFrom ) ;
5252 }
5353
54+ const dryrun = process . env [ "INPUT_DRY-RUN" ] || "false"
55+ if ( ! [ "true" , "false" ] . includes ( dryrun . toLowerCase ( ) ) ) {
56+ console . error ( `Invalid value for dry-run (${ dryrun } ). Must be one of true or false.` ) ;
57+ process . exit ( 1 ) ;
58+ }
59+
60+ if ( dryrun . toLowerCase ( ) === "true" ) { args . push ( "--dry-run" ) }
61+
5462 if ( command === "push" ) {
5563 args . push ( ...process . env . INPUT_COMMITS . split ( / \s + / ) ) ;
5664 } else {
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ inputs:
2424 command :
2525 description : ' Command to run. One of "commit" or "push"'
2626 required : true
27+ dry-run :
28+ description : ' Stop processing just before actually making changes to the remote. Note that the pushed_ref output will be a zeroed commit hash.'
29+ default : false
2730 commits :
2831 description : ' For push, the list of commit hashes to push, oldest first'
2932 files :
You can’t perform that action at this time.
0 commit comments