Skip to content

Commit

Permalink
Fixed draft release being created on release publish
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Dec 12, 2024
1 parent 67b9d62 commit f7687af
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,31 @@ env:
PHP_VERSION: "8.2"

jobs:
skip:
name: Check whether to ignore this tag
runs-on: ubuntu-20.04

outputs:
skip: ${{ steps.exists.outputs.exists == 'true' }}

steps:
- name: Check if release already exists
id: exists
env:
GH_TOKEN: ${{ github.token }}
run: |
exists=false
if [[ "${{ github.ref_type }}" == "tag" ]]; then
tag="$(echo "${{ github.ref }}" | cut -d/ -f3-)"
if gh release view "$tag" --repo "${{ github.repository }}"; then
exists=true
fi
fi
echo exists=$exists >> $GITHUB_OUTPUT
check:
needs: [skip]
if: needs.skip.outputs.skip != 'true'
name: Check release
uses: ./.github/workflows/draft-release-pr-check.yml

Expand Down

0 comments on commit f7687af

Please sign in to comment.