diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index 0a354b5..4429f57 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -37,7 +37,7 @@ jobs: echo "::set-output name=repo_list::${repo_list}" - name: action-git-mirror - uses: k8scat/action-git-mirror@v0.0.24 + uses: k8scat/action-git-mirror@v0.0.25 with: source_protocol: https source_host: github.com diff --git a/Makefile b/Makefile index c4eda3c..4161adb 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ os = $(shell uname -s) -version = 0.0.24 +version = 0.0.25 image = mirror-git:$(version) cr_user = gigrator diff --git a/README.md b/README.md index ed6d52d..d739e7d 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ docker run \ -e INPUT_FORCE_PUSH="false" \ -e INPUT_NOTIFY_PREFIX="Mirror Git" \ -e INPUT_NOTIFY_SUFFIX="Powered by https://github.com/k8scat/action-mirror-git" \ - gigrator/mirror-git:0.0.24 + gigrator/mirror-git:0.0.25 ``` ## LICENSE diff --git a/action.yml b/action.yml index 5888b1d..8080d7c 100644 --- a/action.yml +++ b/action.yml @@ -100,4 +100,4 @@ inputs: default: "false" runs: using: "docker" - image: "docker://ghcr.io/k8scat/mirror-git:0.0.24" + image: "docker://ghcr.io/k8scat/mirror-git:0.0.25" diff --git a/mirror.sh b/mirror.sh index dc3de58..e5e2057 100755 --- a/mirror.sh +++ b/mirror.sh @@ -201,12 +201,10 @@ function mirror() { if [[ -n "${INPUT_DEST_CREATE_REPO_SCRIPT}" ]]; then echo "Creating repo: ${REPO_NAME}" - set -x if ! create_repo; then notify "Failed to create repo: ${REPO_NAME}" return 1 fi - set +x fi repo_dir="${WORKDIR}/${REPO_NAME}" @@ -217,20 +215,16 @@ function mirror() { notify "Failed to push ${REPO_NAME} to ${dest_addr} with --all flag" if [[ "${INPUT_FORCE_PUSH}" = "true" && -n "${INPUT_DEST_DELETE_REPO_SCRIPT}" && -n "${INPUT_DEST_CREATE_REPO_SCRIPT}" ]]; then echo "Deleting repo: ${REPO_NAME}" - set -x if ! delete_repo; then notify "Failed to delete repo: ${REPO_NAME}" return 1 fi - set +x echo "Creating repo: ${REPO_NAME}" - set -x if ! create_repo; then notify "Failed to create repo: ${REPO_NAME}" return 1 fi - set +x if ! git push --all -f "${dest_addr}"; then notify "Still failed to push ${REPO_NAME} to ${dest_addr} with --all flag" @@ -243,20 +237,16 @@ function mirror() { notify "Failed to push ${REPO_NAME} to ${dest_addr} with --mirror flag" if [[ "${INPUT_FORCE_PUSH}" = "true" && -n "${INPUT_DEST_DELETE_REPO_SCRIPT}" && -n "${INPUT_DEST_CREATE_REPO_SCRIPT}" ]]; then echo "Deleting repo: ${REPO_NAME}" - set -x if ! delete_repo; then notify "Failed to delete repo: ${REPO_NAME}" return 1 fi - set +x echo "Creating repo: ${REPO_NAME}" - set -x if ! create_repo; then notify "Failed to create repo: ${REPO_NAME}" return 1 fi - set +x if ! git push --mirror -f "${dest_addr}"; then notify "Still failed to push ${REPO_NAME} to ${dest_addr} with --mirror flag"