Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
50 lines
1.8 KiB
YAML
50 lines
1.8 KiB
YAML
name: vars
|
|
description: Outputs variables that can be useful while creating a release
|
|
outputs:
|
|
should_release:
|
|
description: Indicates whether a release should be created or not
|
|
value: ${{ steps.vars.outputs.should_release }}
|
|
is_release_type_latest:
|
|
description: Shows if release type is latest (not a v* release)
|
|
value: ${{ steps.vars.outputs.is_release_type_latest }}
|
|
tag_name:
|
|
description: Name of the tag that should be used for release
|
|
value: ${{ steps.vars.outputs.tag_name }}
|
|
tarball_prefix:
|
|
description: A prefix to use in tarball asset names
|
|
value: ${{ steps.vars.outputs.tarball_prefix }}
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- id: vars
|
|
run: |
|
|
repo_name=${GITHUB_REPOSITORY##*/}
|
|
ref_name=${GITHUB_REF##*/}
|
|
default_branch=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
|
|
|
|
should_release=true
|
|
is_release_type_latest=false
|
|
tag_name=""
|
|
|
|
if [[ $GITHUB_REF == refs/tags/* ]]
|
|
then
|
|
tag_name=$ref_name
|
|
elif [[ $GITHUB_REF == refs/heads/* && $ref_name == $default_branch ]]
|
|
then
|
|
tag_name=latest
|
|
is_release_type_latest=true
|
|
else
|
|
should_release=false
|
|
fi
|
|
|
|
echo "should_release=$should_release" >> $GITHUB_OUTPUT
|
|
echo "is_release_type_latest=$is_release_type_latest" >> $GITHUB_OUTPUT
|
|
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
|
|
echo "tarball_prefix=$repo_name_$tag_name" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
- run: |
|
|
echo "- should_release: ${{ steps.vars.outputs.should_release }}"
|
|
echo "- is_release_type_latest: ${{ steps.vars.outputs.is_release_type_latest }}"
|
|
echo "- tag_name: ${{ steps.vars.outputs.tag_name }}"
|
|
echo "- tarball_prefix: ${{ steps.vars.outputs.tarball_prefix }}"
|
|
shell: bash
|