Skip to content

Commit

Permalink
Handle prereleased action in GitHub workflow
Browse files Browse the repository at this point in the history
Update the workflow to handle prereleases by modifying the conditions to include "prereleased" in addition to "published" for the "release" event. This ensures that the workflow functions correctly for both prereleases and official releases.
  • Loading branch information
sfmskywalker committed Nov 12, 2024
1 parent 50e2151 commit f626bff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v3
- name: Verify commit exists in branch
run: |
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "published" ]]; then
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && ("${{ github.event.action }}" == "published" || "${{ github.event.action }}" == "prereleased")]]; then
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
else
Expand All @@ -47,7 +47,7 @@ jobs:
fi
- name: Set VERSION variable
run: |
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "published" ]]; then
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && ("${{ github.event.action }}" == "published" || "${{ github.event.action }}" == "prereleased") ]]; then
TAG_NAME=${{ github.ref }} # e.g., refs/tags/3.0.0
TAG_NAME=${TAG_NAME#refs/tags/} # remove the refs/tags/ prefix
echo "VERSION=${TAG_NAME}" >> $GITHUB_ENV
Expand Down

0 comments on commit f626bff

Please sign in to comment.