Skip to content

Commit

Permalink
fix publish ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Mar 13, 2024
1 parent 8f00498 commit 5e61cce
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,32 @@ on:
- '**'

jobs:
# @see https://stackoverflow.com/a/72959712/8179249
check-current-branch:
runs-on: ubuntu-latest

outputs:
branch: ${{ steps.check_step.outputs.branch }}

steps:
- name: 🏗 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🏗 Get current branch
id: check_step
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch="$(echo ${raw//origin\//} | tr -d '\n')"
echo "{name}=branch" >> $GITHUB_OUTPUT
echo "Branches where this tag exists : $branch."
build:
runs-on: ubuntu-latest

needs: check-current-branch

steps:
- name: 🏗 Checkout code
uses: actions/checkout@v4
Expand All @@ -23,6 +47,6 @@ jobs:
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.query-release-info.outputs.release-notes }}
make_latest: ${{ github.ref_name == 'main' && true || false }}
make_latest: contains(${{ needs.check.outputs.branch }}, 'main')
# prerelease: true
# files: '*.vsix'

0 comments on commit 5e61cce

Please sign in to comment.