From f626bff2d50c869da29883100738fe0bdee200eb Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 12 Nov 2024 10:58:50 +0100 Subject: [PATCH] Handle prereleased action in GitHub workflow 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. --- .github/workflows/packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 61e9760f9..387bf9560 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -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 @@ -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