Skip to content

Commit

Permalink
docs: fix cannot get release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
wayjam committed Nov 15, 2024
1 parent 82a5323 commit 8b28b95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
continue-on-error: true

- name: Upload Release Assets
if: steps.get_release.outcome == 'success'
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
description: "Build items"
type: string
default: "binary,docker"
tag:
description: "Tag"
type: string

permissions:
contents: write
Expand All @@ -33,7 +36,15 @@ jobs:
steps:
- name: Get tag
id: get_tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
run: |
if [ "${{ inputs.tag }}" != "" ]; then
echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
elif [[ $GITHUB_REF == refs/tags/* ]]; then
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "No tag specified and not triggered by tag"
exit 1
fi
# Build the Docker image
docker:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ jobs:
uses: benc-uk/workflow-dispatch@v1
with:
workflow: build.yml
inputs: '{ "dry_run": ${{ inputs.dry_run }} }'
inputs: '{ "dry_run": ${{ inputs.dry_run }}, "tag": ${{ steps.tag_version.outputs.new_tag }} }'
ref: ${{ steps.tag_version.outputs.new_tag }}

0 comments on commit 8b28b95

Please sign in to comment.