Skip to content

Commit

Permalink
fix(ci): revert #508 and #509 + exclude HEAD from git branch output i…
Browse files Browse the repository at this point in the history
…n pypi release job (#510)
  • Loading branch information
korikuzma authored Feb 12, 2025
1 parent 6c6c58f commit c99eaad
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,25 @@ on:
tags:
- "*.*.**"
jobs:
get_branch:
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.get_branch_name.outputs.name }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get branch name
id: get_branch_name
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=$(echo "$raw" | grep "origin/main" | grep -v "HEAD" | sed "s|origin/||" | xargs)
echo "name=$branch" >> "$GITHUB_OUTPUT"
build:
name: Build distribution
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: get_branch
if: needs.get_branch.outputs.branch_name == 'main'
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand Down

0 comments on commit c99eaad

Please sign in to comment.