From 8c0a5e6fb2b7217011b444dc316500f404a14642 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 15 Jun 2022 13:53:12 +0800 Subject: [PATCH] fix: tagging on wrong SHA in release --- .github/workflows/release-draft.yml | 14 ++++++++++++-- .github/workflows/release-nocodb.yml | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml index 41369e6006..dcdfbbbdc3 100644 --- a/.github/workflows/release-draft.yml +++ b/.github/workflows/release-draft.yml @@ -10,6 +10,12 @@ on: prev_tag: description: "Previous Tag" required: true + tagHeadSHA: + description: "Use HEAD SHA for tagging" + required: true + type: choice + options: + - "Y" # Triggered by release-nocodb.yml workflow_call: inputs: @@ -21,6 +27,10 @@ on: description: "Previous Tag" required: true type: string + tagHeadSHA: + description: "Use HEAD SHA for tagging" + required: true + type: string secrets: NC_GITHUB_TOKEN: required: true @@ -40,11 +50,11 @@ jobs: # else HEAD will be taken run: | TARGET_SHA=$(git rev-parse HEAD~2) - if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then + if [[ ${{ github.event.inputs.tagHeadSHA || inputs.tagHeadSHA }} == "Y" ]]; then TARGET_SHA=$(git rev-parse HEAD) fi echo "::set-output name=TARGET_SHA::${TARGET_SHA}" - echo "Setting TARGET_SHA: ${{steps.get-sha.outputs.TARGET_SHA}}" + echo "Setting TARGET_SHA: ${TARGET_SHA}" - name: Create tag uses: actions/github-script@v3 with: diff --git a/.github/workflows/release-nocodb.yml b/.github/workflows/release-nocodb.yml index 4f8dc1ebfb..0fe5ba1e03 100644 --- a/.github/workflows/release-nocodb.yml +++ b/.github/workflows/release-nocodb.yml @@ -78,6 +78,7 @@ jobs: with: tag: ${{ needs.process-input.outputs.target_tag }} prev_tag: ${{ needs.process-input.outputs.prev_tag }} + tagHeadSHA: 'N' secrets: NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"