Browse Source

fix: tagging on wrong SHA in release

pull/2378/head
Wing-Kam Wong 2 years ago
parent
commit
8c0a5e6fb2
  1. 14
      .github/workflows/release-draft.yml
  2. 1
      .github/workflows/release-nocodb.yml

14
.github/workflows/release-draft.yml

@ -10,6 +10,12 @@ on:
prev_tag: prev_tag:
description: "Previous Tag" description: "Previous Tag"
required: true required: true
tagHeadSHA:
description: "Use HEAD SHA for tagging"
required: true
type: choice
options:
- "Y"
# Triggered by release-nocodb.yml # Triggered by release-nocodb.yml
workflow_call: workflow_call:
inputs: inputs:
@ -21,6 +27,10 @@ on:
description: "Previous Tag" description: "Previous Tag"
required: true required: true
type: string type: string
tagHeadSHA:
description: "Use HEAD SHA for tagging"
required: true
type: string
secrets: secrets:
NC_GITHUB_TOKEN: NC_GITHUB_TOKEN:
required: true required: true
@ -40,11 +50,11 @@ jobs:
# else HEAD will be taken # else HEAD will be taken
run: | run: |
TARGET_SHA=$(git rev-parse HEAD~2) 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) TARGET_SHA=$(git rev-parse HEAD)
fi fi
echo "::set-output name=TARGET_SHA::${TARGET_SHA}" 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 - name: Create tag
uses: actions/github-script@v3 uses: actions/github-script@v3
with: with:

1
.github/workflows/release-nocodb.yml

@ -78,6 +78,7 @@ jobs:
with: with:
tag: ${{ needs.process-input.outputs.target_tag }} tag: ${{ needs.process-input.outputs.target_tag }}
prev_tag: ${{ needs.process-input.outputs.prev_tag }} prev_tag: ${{ needs.process-input.outputs.prev_tag }}
tagHeadSHA: 'N'
secrets: secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}" NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"

Loading…
Cancel
Save