From 5c58f9d0a0afd4eb1e043abf5f4a20ad4eb3b4cb Mon Sep 17 00:00:00 2001 From: Dan Callahan Date: Fri, 21 Jun 2024 00:04:54 +0100 Subject: [PATCH] ci: Fix tags on ad hoc unitctl releases - Adds `unitctl/` prefix to tags generated by manual workflow runs. Previously, only release titles (but not tags) were prefixed. - Omits superfluous `name` field; falls back to `tag` when absent. - Removes unnecessary conditional from `prelease` field. This results in the following tagging / releasing behavior: 1. Running manually creates a pre-release and tags it `unitctl/VERSION` 2. Pushing a tag formatted like `x.y.z` creates a normal release Refines: 3501a50ffb93756e145295021ff9313ac77f1ba9 --- .github/workflows/unitctl.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unitctl.yml b/.github/workflows/unitctl.yml index e8e5adf87..7664ab0b2 100644 --- a/.github/workflows/unitctl.yml +++ b/.github/workflows/unitctl.yml @@ -186,10 +186,8 @@ jobs: uses: ncipollo/release-action@v1 with: artifacts: "unitctl-*" - # false if triggered by a tag - prerelease: ${{github.event_name == 'workflow_dispatch' && true}} - tag: ${{(github.event_name == 'workflow_dispatch' && inputs.version) || github.ref_name}} - name: unitctl/${{(github.event_name=='workflow_dispatch' && inputs.version) || github.ref_name}} + prerelease: ${{ github.event_name == 'workflow_dispatch' }} + tag: ${{ inputs.version && format('unitctl/{0}', inputs.version) || github.ref_name }} body: > ## Unitctl