From 67b8ce6f4a6fbb082dc738e8009558400321f248 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 08:30:51 +0000 Subject: [PATCH 01/23] chore(github-action): only change dir if required --- entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f265ed5..d11dd39 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,7 +15,11 @@ elif [[ "$GITHUB_REF" == refs/pull/* ]]; then version=pr-${pull_number} release=false fi -cd $DIR # We ensure we are in the right directory + +if [[ "$DIR" != "." ]];then + cd $DIR # We ensure we are in the right directory +fi + PUSH_OPTIONS="" if [ "${OVERRIDE_EXISTING}" == "true" ];then PUSH_OPTIONS="$PUSH_OPTIONS --force" From cd6e644cfde67fe30e88c4f19f63f9d679dcecf5 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 08:46:42 +0000 Subject: [PATCH 02/23] chore(github-action): add debug step --- .github/workflows/on-commit.yml | 6 +++++- entrypoint.sh | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 9f2a2a4..92b68c5 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -13,7 +13,11 @@ jobs: with: repository: 'orange-cloudfoundry/create-bosh-release-action-test-boshrelease' fetch-depth: 0 - + - name: debug + id: debug + run: | + pwd + ls -lrt - name: Test dev release id: test_dev_release uses: orange-cloudfoundry/create-bosh-release-action@master diff --git a/entrypoint.sh b/entrypoint.sh index d11dd39..a62fc9d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,6 +15,9 @@ elif [[ "$GITHUB_REF" == refs/pull/* ]]; then version=pr-${pull_number} release=false fi +echo "Current dir: $PWD" +echo "Current files:" +ls -l if [[ "$DIR" != "." ]];then cd $DIR # We ensure we are in the right directory From a9f01807e500dbe514fa55e7735f75e2ecaadce2 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 09:23:40 +0000 Subject: [PATCH 03/23] use local action --- .github/workflows/on-commit.yml | 23 ++++++++++++++++++----- entrypoint.sh | 20 +++++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 92b68c5..07bb598 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -8,18 +8,31 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository + id: checkout_repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + path: ./create-bosh-release-action + - name: Checkout repository test repo id: checkout_test_repo uses: actions/checkout@v4 with: repository: 'orange-cloudfoundry/create-bosh-release-action-test-boshrelease' fetch-depth: 0 - - name: debug - id: debug +# ref: v1.0 +# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + path: ./create-bosh-release-action-test-boshrelease + + - name: Setup tests + id: setup_tests run: | - pwd - ls -lrt + du -a + git config --global --add safe.directory /github/workspace/create-bosh-release-action-test-boshrelease + git --no-pager config --global --list + - name: Test dev release id: test_dev_release - uses: orange-cloudfoundry/create-bosh-release-action@master + uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow with: target_branch: main + dir: create-bosh-release-action-test-boshrelease diff --git a/entrypoint.sh b/entrypoint.sh index a62fc9d..28c5011 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,16 +15,24 @@ elif [[ "$GITHUB_REF" == refs/pull/* ]]; then version=pr-${pull_number} release=false fi + +echo "*** Inputs ***" +echo " dir: $INPUT_DIR" +echo " override_existing: $INPUT_OVERRIDE_EXISTING" +echo " tag_name: $INPUT_TAG_NAME" +echo " target_branch: $INPUT_TARGET_BRANCH" + +if [[ "$INPUT_DIR" != "." ]];then + cd $INPUT_DIR # We ensure we are in the right directory +fi + echo "Current dir: $PWD" echo "Current files:" ls -l -if [[ "$DIR" != "." ]];then - cd $DIR # We ensure we are in the right directory -fi PUSH_OPTIONS="" -if [ "${OVERRIDE_EXISTING}" == "true" ];then +if [ "${INPUT_OVERRIDE_EXISTING}" == "true" ];then PUSH_OPTIONS="$PUSH_OPTIONS --force" fi @@ -39,6 +47,8 @@ remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https:/ git config --global user.name "actions/bosh-packager@v2" git config --global user.email "<>" git config --global --add safe.directory /github/workspace +git config --global --add safe.directory /github/workspace/create-bosh-release-action-test-boshrelease +git --no-pager config --global --list if [ "${release}" == "true" ]; then # remove existing release if any @@ -81,7 +91,7 @@ if [ "${release}" == "true" ]; then git tag -a -m "cutting release ${version}" ${version} $PUSH_OPTIONS git pull --rebase ${remote_repo} - if [ "${OVERRIDE_EXISTING}" == "true" ] && git rev-parse "$version" >/dev/null 2>&1; then + if [ "${INPUT_OVERRIDE_EXISTING}" == "true" ] && git rev-parse "$version" >/dev/null 2>&1; then # Delete any existing release with same tag. Ignore push failure if no tag exists. git push --delete ${remote_repo} ${version} fi From ffdaed57a476706d4a8c1901235101b2ae6d3aed Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 10:04:56 +0000 Subject: [PATCH 04/23] add dir input to git safe directories --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 28c5011..efd7550 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,6 +24,7 @@ echo " target_branch: $INPUT_TARGET_BRANCH" if [[ "$INPUT_DIR" != "." ]];then cd $INPUT_DIR # We ensure we are in the right directory + git config --global --add safe.directory /github/workspace/$INPUT_DIR fi echo "Current dir: $PWD" @@ -47,7 +48,7 @@ remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https:/ git config --global user.name "actions/bosh-packager@v2" git config --global user.email "<>" git config --global --add safe.directory /github/workspace -git config --global --add safe.directory /github/workspace/create-bosh-release-action-test-boshrelease +echo "*** Git global config ***" git --no-pager config --global --list if [ "${release}" == "true" ]; then From 1beee31ec878b7a730d5b3f83123c5aed6503912 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 10:07:11 +0000 Subject: [PATCH 05/23] add final release creation test --- .github/workflows/on-commit.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 07bb598..35db10c 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -36,3 +36,12 @@ jobs: with: target_branch: main dir: create-bosh-release-action-test-boshrelease + + - name: Test final release + id: test_final_release + uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow + with: + target_branch: main + dir: create-bosh-release-action-test-boshrelease + tag_name: "0.1.0" + override_existing: "true" \ No newline at end of file From 3a250a262ec385eea983694e5b304d981bfad460 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 10:22:15 +0000 Subject: [PATCH 06/23] create final release when tag_name provided --- entrypoint.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index efd7550..6cfcfa3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,17 +21,26 @@ echo " dir: $INPUT_DIR" echo " override_existing: $INPUT_OVERRIDE_EXISTING" echo " tag_name: $INPUT_TAG_NAME" echo " target_branch: $INPUT_TARGET_BRANCH" +echo " debug: $INPUT_DEBUG" if [[ "$INPUT_DIR" != "." ]];then cd $INPUT_DIR # We ensure we are in the right directory git config --global --add safe.directory /github/workspace/$INPUT_DIR fi -echo "Current dir: $PWD" -echo "Current files:" -ls -l +if [ -n "$INPUT_TAG_NAME" ];then + echo "Tag_name detected. Overriding version name and enabling final release" + version=$INPUT_TAG_NAME + release=true +fi +if [ $INPUT_DEBUG -ne 0 ];then + echo "Current files before release creation:" + echo "Current files:" + ls -l +fi + PUSH_OPTIONS="" if [ "${INPUT_OVERRIDE_EXISTING}" == "true" ];then PUSH_OPTIONS="$PUSH_OPTIONS --force" @@ -100,6 +109,13 @@ if [ "${release}" == "true" ]; then git push ${remote_repo} HEAD:${INPUT_TARGET_BRANCH} --follow-tags # Push branch and tag fi + +if [ $INPUT_DEBUG -ne 0 ];then + echo "Current files after release creation:" + ls -l +fi + + # make asset readable outside docker image chmod 644 ${name}-${version}.tgz # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files From 6528d88f0d1df3a78e74cf88e92ee2fd56615f12 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 10:53:57 +0000 Subject: [PATCH 07/23] cleanup generated dev release files --- .github/workflows/on-commit.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 35db10c..a553d18 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -23,12 +23,12 @@ jobs: # token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} path: ./create-bosh-release-action-test-boshrelease - - name: Setup tests - id: setup_tests - run: | - du -a - git config --global --add safe.directory /github/workspace/create-bosh-release-action-test-boshrelease - git --no-pager config --global --list +# - name: Setup tests +# id: setup_tests +# run: | +# du -a +# git config --global --add safe.directory /github/workspace/create-bosh-release-action-test-boshrelease +# git --no-pager config --global --list - name: Test dev release id: test_dev_release @@ -36,7 +36,10 @@ jobs: with: target_branch: main dir: create-bosh-release-action-test-boshrelease - + - name: Cleanup generated test files + run: | + echo "" + git --git-dir=create-bosh-release-action-test-boshrelease clean -fdx - name: Test final release id: test_final_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow @@ -44,4 +47,5 @@ jobs: target_branch: main dir: create-bosh-release-action-test-boshrelease tag_name: "0.1.0" - override_existing: "true" \ No newline at end of file + override_existing: "true" + debug: 1 \ No newline at end of file From f486ba30170ea8d013dc1e89dd358b31785fee4b Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 10:55:13 +0000 Subject: [PATCH 08/23] do not fail when .final_builds is missing --- entrypoint.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6cfcfa3..75d5427 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -35,7 +35,7 @@ if [ -n "$INPUT_TAG_NAME" ];then fi -if [ $INPUT_DEBUG -ne 0 ];then +if [ "$INPUT_DEBUG" -ne 0 ];then echo "Current files before release creation:" echo "Current files:" ls -l @@ -92,7 +92,9 @@ fi if [ "${release}" == "true" ]; then echo "pushing changes to git repository" - git add .final_builds + if [ -d .final_builds ];then + git add .final_builds + fi git add releases/${name}/index.yml git add releases/${name}/${name}-${version}.yml git commit -a -m "cutting release ${version}" @@ -109,8 +111,7 @@ if [ "${release}" == "true" ]; then git push ${remote_repo} HEAD:${INPUT_TARGET_BRANCH} --follow-tags # Push branch and tag fi - -if [ $INPUT_DEBUG -ne 0 ];then +if [ "$INPUT_DEBUG" -ne 0 ];then echo "Current files after release creation:" ls -l fi From 64d391a0b7d34656c435ecb2eb449de022bc2abe Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 10:55:34 +0000 Subject: [PATCH 09/23] document debug mode --- .github/workflows/on-commit.yml | 8 ++++++-- README.md | 4 ++++ action.yml | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index a553d18..f9c7023 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -38,8 +38,12 @@ jobs: dir: create-bosh-release-action-test-boshrelease - name: Cleanup generated test files run: | - echo "" - git --git-dir=create-bosh-release-action-test-boshrelease clean -fdx + ls -lrt + cd create-bosh-release-action-test-boshrelease + git status + echo "Cleanup generated files" + git clean -fdx + cd .. - name: Test final release id: test_final_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow diff --git a/README.md b/README.md index 5dfe4c3..1295557 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ Release directory path if not current working directory required: `false` default: `.` +### `debug` +Set to 1 to enable debug mode + +default: 0 ## Outputs ### `file` diff --git a/action.yml b/action.yml index 525fcbd..0e88772 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,9 @@ inputs: dir: description: "Release directory path if not current working directory (default: .)" default: "." + debug: + description: "Set to 1 to enable debug mode" + default: 0 outputs: file: description: "generated bosh release filename" From da0bd5d9354ce9c6bc9478bcbb945bfbddfb3dc8 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 11:11:44 +0000 Subject: [PATCH 10/23] add repository and token param --- action.yml | 8 ++++++++ entrypoint.sh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/action.yml b/action.yml index 0e88772..aeb36da 100644 --- a/action.yml +++ b/action.yml @@ -3,6 +3,14 @@ name: "bosh-releaser" description: "Creates new version of bosh release" inputs: + repository: + description: "Github repository used to publish releases." + required: false + default: ${GITHUB_REPOSITORY} + token: + description: "Github token used to push changes after releasing" + required: false + default: ${GITHUB_TOKEN} target_branch: description: "Branch name to push release commit" required: false diff --git a/entrypoint.sh b/entrypoint.sh index 75d5427..4857177 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,6 +18,8 @@ fi echo "*** Inputs ***" echo " dir: $INPUT_DIR" +echo " repository: $INPUT_REPOSITORY" +echo " token: **redacted**" echo " override_existing: $INPUT_OVERRIDE_EXISTING" echo " tag_name: $INPUT_TAG_NAME" echo " target_branch: $INPUT_TARGET_BRANCH" From cc600f0336482517032f7955b9fc97bcbe42a29e Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 11:18:52 +0000 Subject: [PATCH 11/23] we cannot cleanup generated files outside action nothing added to commit but untracked files present (use "git add" to track) Cleanup generated files warning: failed to remove dev_releases/create-bosh-release-action-test-boshrelease/index.yml: Permission denied Removing create-bosh-release-action-test-boshrelease-fix-github-actions.tgz warning: failed to remove dev_releases/create-bosh-release-action-test-boshrelease/create-bosh-release-action-test-boshrelease-0+dev.1705403538.yml: Permission denied --- .github/workflows/on-commit.yml | 6 +++--- action.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index f9c7023..04e5cfe 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -36,13 +36,13 @@ jobs: with: target_branch: main dir: create-bosh-release-action-test-boshrelease - - name: Cleanup generated test files + - name: Generated test files status run: | ls -lrt cd create-bosh-release-action-test-boshrelease git status - echo "Cleanup generated files" - git clean -fdx + #echo "Cleanup generated files" + #git clean -fdx cd .. - name: Test final release id: test_final_release diff --git a/action.yml b/action.yml index aeb36da..5ff5f38 100644 --- a/action.yml +++ b/action.yml @@ -6,11 +6,11 @@ inputs: repository: description: "Github repository used to publish releases." required: false - default: ${GITHUB_REPOSITORY} + default: ${{github.repository}} token: description: "Github token used to push changes after releasing" required: false - default: ${GITHUB_TOKEN} + default: ${{github.token}} target_branch: description: "Branch name to push release commit" required: false From f810245c1b2fc5698a7ab1b376eb1d8b8187ca90 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 13:29:26 +0000 Subject: [PATCH 12/23] override repository for final release test --- .github/workflows/on-commit.yml | 1 + entrypoint.sh | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 04e5cfe..b1036b1 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -48,6 +48,7 @@ jobs: id: test_final_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow with: + repository: orange-cloudfoundry/create-bosh-release-action-test-boshrelease target_branch: main dir: create-bosh-release-action-test-boshrelease tag_name: "0.1.0" diff --git a/entrypoint.sh b/entrypoint.sh index 4857177..2ec6e8f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -39,7 +39,6 @@ fi if [ "$INPUT_DEBUG" -ne 0 ];then echo "Current files before release creation:" - echo "Current files:" ls -l fi @@ -53,7 +52,7 @@ if [ "${name}" = "null" ]; then name=$(yq -r .name config/final.yml) fi -remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" +remote_repo="https://${GITHUB_ACTOR}:${INPUT_TOKEN}@${GITHUB_SERVER_URL#https://}/${INPUT_REPOSITORY}.git" # configure git git config --global user.name "actions/bosh-packager@v2" From 8324d64f864b3547b11ae76df93f1ffd3b33e6a9 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 14:24:00 +0000 Subject: [PATCH 13/23] override token for final release test --- .github/workflows/on-commit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index b1036b1..cb42f19 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -49,8 +49,9 @@ jobs: uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow with: repository: orange-cloudfoundry/create-bosh-release-action-test-boshrelease + token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} target_branch: main dir: create-bosh-release-action-test-boshrelease tag_name: "0.1.0" override_existing: "true" - debug: 1 \ No newline at end of file + debug: 1 From 32b6702af67dd7923acf6116e583a58a950cb1c6 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 14:28:58 +0000 Subject: [PATCH 14/23] override token on test repo checkout --- .github/workflows/on-commit.yml | 6 +++--- entrypoint.sh | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index cb42f19..c55f04a 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -20,16 +20,16 @@ jobs: repository: 'orange-cloudfoundry/create-bosh-release-action-test-boshrelease' fetch-depth: 0 # ref: v1.0 -# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - path: ./create-bosh-release-action-test-boshrelease + token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} + path: ./create-bosh-release-action-test-boshrelease # - name: Setup tests # id: setup_tests # run: | # du -a # git config --global --add safe.directory /github/workspace/create-bosh-release-action-test-boshrelease -# git --no-pager config --global --list +# git --no-pager config --global --list - name: Test dev release id: test_dev_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow diff --git a/entrypoint.sh b/entrypoint.sh index 2ec6e8f..e4d29fa 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -104,10 +104,10 @@ if [ "${release}" == "true" ]; then git tag -a -m "cutting release ${version}" ${version} $PUSH_OPTIONS git pull --rebase ${remote_repo} - if [ "${INPUT_OVERRIDE_EXISTING}" == "true" ] && git rev-parse "$version" >/dev/null 2>&1; then - # Delete any existing release with same tag. Ignore push failure if no tag exists. - git push --delete ${remote_repo} ${version} - fi +# if [ "${INPUT_OVERRIDE_EXISTING}" == "true" ] && git rev-parse "$version" >/dev/null 2>&1; then +# # Delete any existing release with same tag. Ignore push failure if no tag exists. +# git push --delete ${remote_repo} ${version} +# fi git push ${remote_repo} HEAD:${INPUT_TARGET_BRANCH} --follow-tags # Push branch and tag fi From 40fa93af3da5f2948e4b98a4d49c56162fe573b3 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Tue, 16 Jan 2024 16:12:21 +0000 Subject: [PATCH 15/23] rework tag delete --- .github/workflows/on-commit.yml | 4 ++++ README.md | 10 ++++++++++ action.yml | 2 ++ entrypoint.sh | 13 +++++++++---- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index c55f04a..5b1b6f9 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -5,6 +5,7 @@ on: push: jobs: build: + name: "Test dev and final release creation" runs-on: ubuntu-latest steps: - name: Checkout repository @@ -40,7 +41,10 @@ jobs: run: | ls -lrt cd create-bosh-release-action-test-boshrelease + echo "Display create-bosh-release-action-test-boshrelease git repo status:" git status + echo "List existing tags:" + git tag --list #echo "Cleanup generated files" #git clean -fdx cd .. diff --git a/README.md b/README.md index 1295557..ba80e93 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,14 @@ default: 0 Name of the generated release. +### `version` + +version of the generated bosh release + +### `need_gh_release` + +Do we need to create a GitHub release associated to this bosh release + ## Example usage ``` @@ -46,3 +54,5 @@ env: AWS_BOSH_ACCES_KEY_ID: ${{ secrets.AWS_BOSH_ACCES_KEY_ID }} AWS_BOSH_SECRET_ACCES_KEY: ${{ secrets.AWS_BOSH_SECRET_ACCES_KEY }} ``` + +See [GitHub action for extra samples](./.github/workflows/on-commit.yml) diff --git a/action.yml b/action.yml index 5ff5f38..c481702 100644 --- a/action.yml +++ b/action.yml @@ -33,6 +33,8 @@ outputs: description: "generated bosh release filename" version: description: "version of the generated bosh release" + need_gh_release: + description: "Do we need to create a github release associated to this bosh release" runs: using: "docker" diff --git a/entrypoint.sh b/entrypoint.sh index e4d29fa..cac7eff 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,6 +61,10 @@ git config --global --add safe.directory /github/workspace echo "*** Git global config ***" git --no-pager config --global --list +# remove existing release if any, and prepare a commit that will be amended next +# Having a single amended commit makes it easier to inspect last commit +# See https://superuser.com/a/360986/299481 for details of the bash array syntax +NEXT_GIT_COMMIT_FLAGS=(-m "cutting release ${version}") if [ "${release}" == "true" ]; then # remove existing release if any if [ -f releases/"${name}"/"${name}"-"${version}".yml ]; then @@ -104,10 +108,10 @@ if [ "${release}" == "true" ]; then git tag -a -m "cutting release ${version}" ${version} $PUSH_OPTIONS git pull --rebase ${remote_repo} -# if [ "${INPUT_OVERRIDE_EXISTING}" == "true" ] && git rev-parse "$version" >/dev/null 2>&1; then -# # Delete any existing release with same tag. Ignore push failure if no tag exists. -# git push --delete ${remote_repo} ${version} -# fi + if [[ "${INPUT_OVERRIDE_EXISTING}" == "true" ]]; then + # Delete any existing release with same tag. Ignore push failure if no tag exists. + ! git push --delete ${remote_repo} ${version} + fi git push ${remote_repo} HEAD:${INPUT_TARGET_BRANCH} --follow-tags # Push branch and tag fi @@ -123,4 +127,5 @@ chmod 644 ${name}-${version}.tgz # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files echo "file=${name}-${version}.tgz" >> $GITHUB_OUTPUT echo "version=${version}" >> $GITHUB_OUTPUT +echo "need_gh_release=${NEED_GITHUB_RELEASE}" >> $GITHUB_OUTPUT From 926a70541aef2b73b10e114174a86f76353fd35c Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 10:05:47 +0000 Subject: [PATCH 16/23] chore(github-action): polish logs --- .github/workflows/on-commit.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 5b1b6f9..32a6e8f 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -24,14 +24,7 @@ jobs: token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} path: ./create-bosh-release-action-test-boshrelease -# - name: Setup tests -# id: setup_tests -# run: | -# du -a -# git config --global --add safe.directory /github/workspace/create-bosh-release-action-test-boshrelease - -# git --no-pager config --global --list - - name: Test dev release + - name: Test dev release creation id: test_dev_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow with: @@ -48,7 +41,7 @@ jobs: #echo "Cleanup generated files" #git clean -fdx cd .. - - name: Test final release + - name: Test final release creation id: test_final_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow with: From e8e336c2df844457888828780d776c565c33a3e1 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 10:11:09 +0000 Subject: [PATCH 17/23] resync code with k3s-package https://github.com/orange-cloudfoundry/k3s-packages-boshrelease/commit/316b624e0ab8d19e72281c78fce161073e155bd7 --force is required to ignore dev_releases/ dir, created during final release ``` creating bosh release: create-bosh-release-action-test-boshrelease-0.1.0.tgz Git repository has local modifications: ?? dev_releases/ ``` --- entrypoint.sh | 53 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index cac7eff..8853f7f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -72,11 +72,14 @@ if [ "${release}" == "true" ]; then yq -r "{ \"builds\": (.builds | with_entries(select(.value.version != \"${version}\"))), \"format-version\": .[\"format-version\"]}" < releases/${name}/index.yml > tmp mv tmp releases/"${name}"/index.yml rm -f releases/"${name}"/"${name}"-"${version}".yml - git commit -a -m "reset release ${version}" + git add releases/${name}/${name}-${version}.yml releases/${name}/index.yml + git commit -a "${NEXT_GIT_COMMIT_FLAGS[@]}" + NEXT_GIT_COMMIT_FLAGS=(--amend -m "cutting release ${version} overriding existing one") fi fi if [ -n "${AWS_BOSH_ACCES_KEY_ID}" ]; then + echo "Generating AWS config" cat - > config/private.yml <> $GITHUB_OUTPUT -echo "version=${version}" >> $GITHUB_OUTPUT -echo "need_gh_release=${NEED_GITHUB_RELEASE}" >> $GITHUB_OUTPUT +echo "file=${name}-${version}.tgz" >> $GITHUB_OUTPUT +echo "version=${version}" >> $GITHUB_OUTPUT +echo "need_gh_release=${NEED_GITHUB_RELEASE}" >> $GITHUB_OUTPUT From b77c7751a14a23c08bd6456d99a353dafd9c506b Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 10:28:34 +0000 Subject: [PATCH 18/23] test(): dedicated local repo --- .github/workflows/on-commit.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 32a6e8f..60bd918 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -24,22 +24,24 @@ jobs: token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} path: ./create-bosh-release-action-test-boshrelease + - name: Setup test + run: | + git clone create-bosh-release-action-test-boshrelease dev-release-creation-test + git clone create-bosh-release-action-test-boshrelease final-release-creation-test - name: Test dev release creation id: test_dev_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow with: target_branch: main - dir: create-bosh-release-action-test-boshrelease - - name: Generated test files status + dir: dev-release-creation-test + - name: Generated test dev files status run: | ls -lrt - cd create-bosh-release-action-test-boshrelease - echo "Display create-bosh-release-action-test-boshrelease git repo status:" + cd dev-release-creation-test + echo "Display dev-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:" git status echo "List existing tags:" git tag --list - #echo "Cleanup generated files" - #git clean -fdx cd .. - name: Test final release creation id: test_final_release @@ -48,7 +50,16 @@ jobs: repository: orange-cloudfoundry/create-bosh-release-action-test-boshrelease token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} target_branch: main - dir: create-bosh-release-action-test-boshrelease + dir: final-release-creation-test tag_name: "0.1.0" override_existing: "true" debug: 1 + - name: Generated final dev files status + run: | + ls -lrt + cd final-release-creation-test + echo "Display final-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:" + git status + echo "List existing tags:" + git tag --list + cd .. From c161f4bdaa709ff40378e1431b28ae8c6df2b1f1 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 11:06:00 +0000 Subject: [PATCH 19/23] test creation of new release --- .github/workflows/on-commit.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 60bd918..062816b 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -22,7 +22,6 @@ jobs: fetch-depth: 0 # ref: v1.0 token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} - path: ./create-bosh-release-action-test-boshrelease - name: Setup test run: | @@ -43,7 +42,7 @@ jobs: echo "List existing tags:" git tag --list cd .. - - name: Test final release creation + - name: Test final release creation existing tag id: test_final_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow with: @@ -54,7 +53,33 @@ jobs: tag_name: "0.1.0" override_existing: "true" debug: 1 - - name: Generated final dev files status + - name: Generated final files status - override + run: | + ls -lrt + cd final-release-creation-test + echo "Display final-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:" + git status + echo "List existing tags:" + git tag --list + cd .. + - name: Get Next Version + id: semver-final-release + uses: ietf-tools/semver-action@v1 + with: + token: ${{ github.token }} + branch: main + - name: Test final release creation new tag + id: test_final_new_release + uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow + with: + repository: orange-cloudfoundry/create-bosh-release-action-test-boshrelease + token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} + target_branch: main + dir: final-release-creation-test + tag_name: "${{ steps.semver-final-release.outputs.nextStrict }}" + override_existing: "false" + debug: 1 + - name: Generated final files status - new run: | ls -lrt cd final-release-creation-test From c63a18b646bcb3f527ebaa4fe5796afeed020a59 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 12:52:12 +0000 Subject: [PATCH 20/23] create tag with v prefix --- entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8853f7f..1d1145c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,6 +6,7 @@ set -e if [[ "$GITHUB_REF" == refs/tags/* ]]; then version=${GITHUB_REF#refs/tags/} version=${version#v} + tag_version=v${version} release=true elif [[ "$GITHUB_REF" == refs/heads/* ]]; then version=${GITHUB_REF#refs/heads/} @@ -33,6 +34,8 @@ fi if [ -n "$INPUT_TAG_NAME" ];then echo "Tag_name detected. Overriding version name and enabling final release" version=$INPUT_TAG_NAME + version=${version#v} + tag_version=v${version} release=true fi @@ -120,7 +123,7 @@ if [ "${release}" == "true" ]; then else echo "pushing changes to git repository" # Override any existing tag with same version. This may happen if only part of the renovate PRs were merged - git tag -a -m "cutting release ${version}" ${version} $PUSH_OPTIONS + git tag -a -m "cutting release ${tag_version}" ${tag_version} $PUSH_OPTIONS # In case a renovate PR was merged in between, try to rebase prior to pushing git pull --rebase ${remote_repo} if [[ "${INPUT_OVERRIDE_EXISTING}" == "true" ]]; then From 677b6f3ed7ad117e15194cbc48e5b851eef251e9 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 13:35:06 +0000 Subject: [PATCH 21/23] rework semver detection --- .github/workflows/on-commit.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 062816b..97c3700 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -50,7 +50,7 @@ jobs: token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} target_branch: main dir: final-release-creation-test - tag_name: "0.1.0" + tag_name: "v0.2.0" override_existing: "true" debug: 1 - name: Generated final files status - override @@ -59,15 +59,20 @@ jobs: cd final-release-creation-test echo "Display final-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:" git status + echo "Checking tgz" + ls -l create-bosh-release-action-test-boshrelease-0.2.0.tgz echo "List existing tags:" git tag --list cd .. - name: Get Next Version id: semver-final-release - uses: ietf-tools/semver-action@v1 - with: - token: ${{ github.token }} - branch: main + run: | + cd + latest_tag=$(git describe --tags --abbrev=0) + major_minor=$(echo $latest_tag|cut -d'.' -f1-2) + patch=$(echo $latest_tag|cut -d'.' -f3) + next_patch=$((patch + 1)) + echo "nextVersion=${major_minor}.$next_patch" >> "$GITHUB_ENV" - name: Test final release creation new tag id: test_final_new_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow @@ -76,15 +81,20 @@ jobs: token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} target_branch: main dir: final-release-creation-test - tag_name: "${{ steps.semver-final-release.outputs.nextStrict }}" + tag_name: "${{ steps.semver-final-release.env.nextVersion }}" override_existing: "false" debug: 1 - name: Generated final files status - new + env: + NEXT_VERSION: "${{ steps.semver-final-release.env.nextVersion }}" run: | ls -lrt cd final-release-creation-test echo "Display final-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:" git status + echo "Checking tgz" + expected_version=${NEXT_VERSION#v} + ls -l create-bosh-release-action-test-boshrelease-$expected_version.tgz echo "List existing tags:" git tag --list cd .. From 28a29fcdf8276ae5a9ffc996a90603cf8307ab40 Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 14:02:05 +0000 Subject: [PATCH 22/23] test(): ensure tags for final release exist --- .github/workflows/on-commit.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 97c3700..257e4e0 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -63,16 +63,19 @@ jobs: ls -l create-bosh-release-action-test-boshrelease-0.2.0.tgz echo "List existing tags:" git tag --list + echo "Ensure tag exist + git tag --list|grep -E "^v0.2.0$" cd .. - name: Get Next Version id: semver-final-release run: | - cd + cd create-bosh-release-action-test-boshrelease latest_tag=$(git describe --tags --abbrev=0) major_minor=$(echo $latest_tag|cut -d'.' -f1-2) patch=$(echo $latest_tag|cut -d'.' -f3) next_patch=$((patch + 1)) echo "nextVersion=${major_minor}.$next_patch" >> "$GITHUB_ENV" + cd .. - name: Test final release creation new tag id: test_final_new_release uses: ./create-bosh-release-action/ # uses: ./.github/actions/my-private-repo/my-action #https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-an-action-inside-a-different-private-repository-than-the-workflow @@ -97,4 +100,6 @@ jobs: ls -l create-bosh-release-action-test-boshrelease-$expected_version.tgz echo "List existing tags:" git tag --list + echo "Ensure tag exist" + git tag --list|grep -E "^$NEXT_VERSION$" cd .. From 8ebbdc4d9cada807dda637af36a65ff87e8e9afc Mon Sep 17 00:00:00 2001 From: Olivier ORAND Date: Wed, 17 Jan 2024 14:04:39 +0000 Subject: [PATCH 23/23] ensure we push changes (commits and tags) on a new release, even without blobs change --- .github/workflows/on-commit.yml | 27 +++++++++++++++------------ entrypoint.sh | 6 ++++-- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 257e4e0..95dfc46 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -50,7 +50,7 @@ jobs: token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} target_branch: main dir: final-release-creation-test - tag_name: "v0.2.0" + tag_name: "v0.3.0" override_existing: "true" debug: 1 - name: Generated final files status - override @@ -60,21 +60,24 @@ jobs: echo "Display final-release-creation-test(create-bosh-release-action-test-boshrelease) git repo status:" git status echo "Checking tgz" - ls -l create-bosh-release-action-test-boshrelease-0.2.0.tgz + ls -l create-bosh-release-action-test-boshrelease-0.3.0.tgz echo "List existing tags:" git tag --list - echo "Ensure tag exist - git tag --list|grep -E "^v0.2.0$" + echo "Ensure tag exist v0.3.0" + git tag --list|grep -E "^v0.3.0$" cd .. - name: Get Next Version id: semver-final-release run: | - cd create-bosh-release-action-test-boshrelease - latest_tag=$(git describe --tags --abbrev=0) - major_minor=$(echo $latest_tag|cut -d'.' -f1-2) - patch=$(echo $latest_tag|cut -d'.' -f3) - next_patch=$((patch + 1)) - echo "nextVersion=${major_minor}.$next_patch" >> "$GITHUB_ENV" + cd create-bosh-release-action-test-boshrelease + latest_tag=$(git describe --tags --abbrev=0) + echo "latest tag found: $latest_tag" + major_minor=$(echo $latest_tag|cut -d'.' -f1-2) + patch=$(echo $latest_tag|cut -d'.' -f3) + next_patch=$((patch + 1)) + nextVersion=${major_minor}.$next_patch + echo "nextVersion: $nextVersion" + echo "nextVersion=$nextVersion" >> "$GITHUB_OUTPUT" cd .. - name: Test final release creation new tag id: test_final_new_release @@ -84,12 +87,12 @@ jobs: token: ${{ secrets.CREATE_BOSH_RELEASE_ACTION_TEST_BOSHRELEASE_GIT_TOKEN }} target_branch: main dir: final-release-creation-test - tag_name: "${{ steps.semver-final-release.env.nextVersion }}" + tag_name: "${{ steps.semver-final-release.outputs.nextVersion }}" override_existing: "false" debug: 1 - name: Generated final files status - new env: - NEXT_VERSION: "${{ steps.semver-final-release.env.nextVersion }}" + NEXT_VERSION: "${{ steps.semver-final-release.outputs.nextVersion }}" run: | ls -lrt cd final-release-creation-test diff --git a/entrypoint.sh b/entrypoint.sh index 1d1145c..f4782d0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -68,6 +68,7 @@ git --no-pager config --global --list # Having a single amended commit makes it easier to inspect last commit # See https://superuser.com/a/360986/299481 for details of the bash array syntax NEXT_GIT_COMMIT_FLAGS=(-m "cutting release ${version}") +FIRST_FINAL_RELEASE="false" if [ "${release}" == "true" ]; then # remove existing release if any if [ -f releases/"${name}"/"${name}"-"${version}".yml ]; then @@ -78,6 +79,8 @@ if [ "${release}" == "true" ]; then git add releases/${name}/${name}-${version}.yml releases/${name}/index.yml git commit -a "${NEXT_GIT_COMMIT_FLAGS[@]}" NEXT_GIT_COMMIT_FLAGS=(--amend -m "cutting release ${version} overriding existing one") + else + FIRST_FINAL_RELEASE="true" fi fi @@ -114,12 +117,11 @@ if [ "${release}" == "true" ]; then echo "Inspecting staged files to skip commit and push if there is no blob changes in the release" git show HEAD ${RELEASE_FILE_NAME} - if ! git show HEAD ${RELEASE_FILE_NAME} | grep sha1 ; then + if [[ $FIRST_FINAL_RELEASE == false ]] && ! git show HEAD ${RELEASE_FILE_NAME} | grep sha1 ; then echo "No sha1 found in diff in ${RELEASE_FILE_NAME}. No blob were modified. Skipping the git push" ls -al ${RELEASE_FILE_NAME} cat ${RELEASE_FILE_NAME} NEED_GITHUB_RELEASE="false" - else echo "pushing changes to git repository" # Override any existing tag with same version. This may happen if only part of the renovate PRs were merged