Skip to content

Commit 350bf5d

Browse files
committed
Add force_push option
1 parent 0624a27 commit 350bf5d

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ GitHub Actions to publish AUR package.
3232

3333
**Optional** Allow empty commits, i.e. commits with no change. The default value is `true`.
3434

35+
## `force_push`
36+
37+
**Optional** Use `--force` when push to the AUR. The default value is `false`.
38+
3539
### `ssh_keyscan_types`
3640

3741
**Optional** Comma-separated list of types to use when adding aur.archlinux.org to known hosts.

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ inputs:
2828
description: 'Allow empty commits, i.e. commits with no change.'
2929
required: false
3030
default: 'true'
31+
force_push:
32+
description: 'Use --force when push to the AUR.'
33+
required: false
34+
default: 'false'
3135
ssh_keyscan_types:
3236
description: 'Comma-separated list of types to use when adding aur.archlinux.org to known hosts'
3337
required: false

build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ commit_email=$INPUT_COMMIT_EMAIL
99
ssh_private_key=$INPUT_SSH_PRIVATE_KEY
1010
commit_message=$INPUT_COMMIT_MESSAGE
1111
allow_empty_commits=$INPUT_ALLOW_EMPTY_COMMITS
12+
force_push=$INPUT_FORCE_PUSH
1213
ssh_keyscan_types=$INPUT_SSH_KEYSCAN_TYPES
1314

1415
export HOME=/home/builder
@@ -62,5 +63,14 @@ false)
6263
exit 2
6364
;;
6465
esac
65-
git push --force-with-lease -v aur master
66+
force_push_flag=''
67+
case "$force_push" in
68+
true) force_push_flag='--force' ;;
69+
false) force_push_flag='--force-with-lease' ;;
70+
*)
71+
echo "::error::Invalid Value: inputs.force_push is neither 'true' nor 'false': '$force_push'"
72+
exit 3
73+
;;
74+
esac
75+
git push "$force_push_flag" -v aur master
6676
echo '::endgroup::'

0 commit comments

Comments
 (0)