From afde9c6c9416d04d19eba8cfe8f8e4cc0f2744da Mon Sep 17 00:00:00 2001 From: Volodymyr Pochtar Date: Thu, 3 Nov 2022 21:50:19 +0200 Subject: [PATCH] ci: return 7 symbols short git hash on branch build (#18934) --- .github/actions/build-branch/action.yml | 8 +------- .github/workflows/publish-oss-for-cloud.yml | 10 +--------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/actions/build-branch/action.yml b/.github/actions/build-branch/action.yml index c2eca92897dc7..e1df48d97e2d9 100644 --- a/.github/actions/build-branch/action.yml +++ b/.github/actions/build-branch/action.yml @@ -18,13 +18,7 @@ runs: # if the *branch_version_tag* input param is not specified, then generate it as 'dev-` # [[ "${{ inputs.branch_version_tag }}" != '' ]] && echo "branch_version_tag=${{ inputs.branch_version_tag }}" >> $GITHUB_OUTPUT \ - || { short_hash=$(git rev-parse --short HEAD); echo "branch_version_tag=dev-$short_hash" >> $GITHUB_OUTPUT ; } - cat $GITHUB_OUTPUT || true # for the sake of investigation - - # if the *branch_version_tag* input param is not specified, then generate it as 'dev-` - # - [[ "${{ inputs.branch_version_tag }}" != '' ]] && echo "::set-output name=branch_version_tag::${{ inputs.branch_version_tag }}" \ - || { short_hash=$(git rev-parse --short HEAD); echo "::set-output name=branch_version_tag::dev-$short_hash"; } + || { short_hash=$(git rev-parse --short=7 HEAD); echo "branch_version_tag=dev-$short_hash" >> $GITHUB_OUTPUT ; } - uses: actions/setup-java@v1 with: diff --git a/.github/workflows/publish-oss-for-cloud.yml b/.github/workflows/publish-oss-for-cloud.yml index 11ffd9d98c390..f3a5937f15770 100644 --- a/.github/workflows/publish-oss-for-cloud.yml +++ b/.github/workflows/publish-oss-for-cloud.yml @@ -62,7 +62,7 @@ jobs: run: |- set -x - commit_sha=$(git rev-parse --short HEAD) + commit_sha=$(git rev-parse --short=7 HEAD) # set dev_tag # AirbyteVersion.java allows versions that have a prefix of 'dev' @@ -74,14 +74,6 @@ jobs: fi cat $GITHUB_OUTPUT || true # for the sake of investigation - # set dev_tag - # AirbyteVersion.java allows versions that have a prefix of 'dev' - echo "::set-output name=dev_tag::dev-${commit_sha}" - - if $(git merge-base --is-ancestor "${commit_sha}" master); then - echo "::set-output name=master_tag::${commit_sha}" - fi - oss-branch-build: name: "Gradle Build and Publish" needs: