Skip to content

Commit

Permalink
ci: Release action error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahanaFarooqui committed Dec 3, 2024
1 parent f2b4b50 commit a9be690
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+[0-9a-z]+'
workflow_dispatch:
inputs:
create_release:
description: Create a draft release
default: no
type: choice
options:
- yes
- no
ref_type:
description: 'Ref type (tag or branch)'
required: true
default: 'tag'
ref_name:
description: 'Ref name (e.g., v24.11 or master)'
required: true
default: 'v24.11'

jobs:
check:
Expand All @@ -26,16 +35,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Determine version from pushed tag
if: ${{ github.ref_type == 'tag' }}
run: echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV"

# Relevant for testing branches.
- name: Determine version from pushed branch tag
if: ${{ github.ref_type == 'branch' }}
run: echo "VERSION=$(git tag --points-at HEAD)" >> "$GITHUB_ENV"
- name: Determine version
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
VERSION="${{ github.ref_name }}"
elif [ "${{ github.ref_type }}" == "branch" ]; then
VERSION=$(git tag --points-at HEAD)
if [ -z "$VERSION" ]; then
VERSION="${{ github.ref_name }}"
fi
fi
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "Determined version: $VERSION"
- name: Validate release
run: tools/check-release.sh --version=${VERSION}
Expand Down

0 comments on commit a9be690

Please sign in to comment.