From 12dced18cc5fda022ffd6ae1e54457fc33e2f4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bj=C3=B8rn?= Date: Thu, 13 Jul 2023 15:46:32 +0200 Subject: [PATCH 1/3] Update entrypoint.sh --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5099097..d1b82a5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,6 +12,7 @@ REMOTE=${INPUT_REMOTE:-"$*"} REMOTE_NAME=${INPUT_REMOTE_NAME:-"mirror"} GIT_SSH_PRIVATE_KEY=${INPUT_GIT_SSH_PRIVATE_KEY} GIT_SSH_PUBLIC_KEY=${INPUT_GIT_SSH_PUBLIC_KEY} +GIT_REF=${INPUT_GIT_REF} GIT_PUSH_ARGS=${INPUT_GIT_PUSH_ARGS:-"--tags --force --prune"} GIT_SSH_NO_VERIFY_HOST=${INPUT_GIT_SSH_NO_VERIFY_HOST} GIT_SSH_KNOWN_HOSTS=${INPUT_GIT_SSH_KNOWN_HOSTS} @@ -71,6 +72,6 @@ else echo "FATAL: You must upgrade to using actions inputs instead of args: to push a single branch" > /dev/stderr exit 1 else - eval git push -u ${GIT_PUSH_ARGS} ${REMOTE_NAME} "${GITHUB_REF}" + eval git push -u ${GIT_PUSH_ARGS} ${REMOTE_NAME} "${GIT_REF}" fi fi From 110b64921bbaa08ca691d3d7a27606f430fd71a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bj=C3=B8rn?= Date: Thu, 13 Jul 2023 15:46:40 +0200 Subject: [PATCH 2/3] Update action.yml --- action.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 5c5037a..ffdb9ee 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: description: "Username for remote repository" required: false GIT_PASSWORD: - description: "The git https password or token for the remote repository" + description: "The git HTTPS password or token for the remote repository" required: false GIT_SSH_PRIVATE_KEY: description: "The ssh private key for writing to the remote repository, if using ssh" @@ -24,18 +24,22 @@ inputs: description: "The ssh public key for writing to the remote repository. Normally, not required at all" required: false GIT_SSH_KNOWN_HOSTS: - description: "The contents of a SSH known_hosts file for host key verification" + description: "The contents of an SSH known_hosts file for host key verification" required: false GIT_SSH_NO_VERIFY_HOST: - description: "if true, skips host key verification. Mutually exclusive with GIT_SSH_KNOWN_HOSTS" + description: "If true, skip host key verification. Mutually exclusive with GIT_SSH_KNOWN_HOSTS" default: "false" required: false + GIT_REF: + description: "Push another ref rather than the current branch (GITHUB_REF) from which the action was triggered. Only effective when PUSH_ALL_REFS is false" + default: ${{ github.head_ref || github.ref_name }} + required: false PUSH_ALL_REFS: description: "Push all refs instead of just the current branch" default: "true" required: false GIT_PUSH_ARGS: - description: "The arugments to use when pushing the repository" + description: "The arguments to use when pushing the repository" default: '--tags --force --prune' required: false DEBUG: From 05fbec2c03e19945dac4adab05ac20f8836438b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bj=C3=B8rn?= Date: Sat, 15 Jul 2023 12:13:32 +0200 Subject: [PATCH 3/3] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ffdb9ee..c0894aa 100644 --- a/action.yml +++ b/action.yml @@ -32,7 +32,7 @@ inputs: required: false GIT_REF: description: "Push another ref rather than the current branch (GITHUB_REF) from which the action was triggered. Only effective when PUSH_ALL_REFS is false" - default: ${{ github.head_ref || github.ref_name }} + default: ${{ github.ref }} required: false PUSH_ALL_REFS: description: "Push all refs instead of just the current branch"