File tree 3 files changed +12
-4
lines changed
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Action to commit a file/directory to another repo using a deploy key.
7
7
* Add the private key to your source repo as a secret
8
8
9
9
``` yaml
10
- uses : leigholiver/commit-with-deploy-key@v1.0.2
10
+ uses : leigholiver/commit-with-deploy-key@v1.1.0
11
11
with :
12
12
source : build_output
13
13
destination_folder : dist
Original file line number Diff line number Diff line change 1
- v1.0.3
1
+ v1.1.0
Original file line number Diff line number Diff line change @@ -42,10 +42,18 @@ elif [ -d $CALLING_DIR/$INPUT_SOURCE ]; then
42
42
cp -a $CALLING_DIR /$INPUT_SOURCE /* .
43
43
fi
44
44
45
- # commit and push
45
+ # create the commit
46
46
git add .
47
47
git commit -m " ${INPUT_COMMIT_MESSAGE} "
48
- GIT_SSH_COMMAND=$GIT_SSH git push -u origin $INPUT_DESTINATION_BRANCH
48
+
49
+ # if there is a new commit - push it to the destination
50
+ if [ ! -z " $( git cherry -v) " ]; then
51
+ GIT_SSH_COMMAND=$GIT_SSH git push -u origin $INPUT_DESTINATION_BRANCH
52
+
53
+ # otherwise, don't try to push - this causes the workflow to fail
54
+ else
55
+ echo " Nothing waiting to be pushed"
56
+ fi
49
57
50
58
# output the commit hash
51
59
echo " ::set-output name=commit_hash::$( git rev-parse HEAD) "
You can’t perform that action at this time.
0 commit comments