From 069263e22dc7d785dfb82837456b004b3a86450f Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 28 Mar 2024 20:21:51 +0200 Subject: [PATCH] .github: fix 'v'-tag-is-release logic. Now that we're more selective with our triggering tags, it is safe to go with the simple 'a tag is always a release' logic. However, evaluating the condition once then passing the result on in the environment to alternative jobs within the workflow does not work as expected. Therefore, evaluate the condition directly whenever we need the result. Signed-off-by: Krisztian Litkey --- .github/workflows/package-helm.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package-helm.yaml b/.github/workflows/package-helm.yaml index 4a52bb59c..10b18ea84 100644 --- a/.github/workflows/package-helm.yaml +++ b/.github/workflows/package-helm.yaml @@ -10,7 +10,6 @@ on: env: CHARTS_DIR: deployment/helm/ - IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') && 'true' || 'false' }} UNSTABLE_CHARTS: unstable-helm-charts REGISTRY: ghcr.io REGISTRY_USER: ${{ github.repository_owner }} @@ -18,7 +17,7 @@ env: jobs: release: - if: ${{ github.env.IS_RELEASE == 'true' }} + if: ${{ startsWith(github.ref, 'refs/tags/v') }} permissions: contents: write runs-on: ubuntu-latest @@ -48,10 +47,10 @@ jobs: files: nri-*helm-chart*.tgz unstable: + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} concurrency: group: unstable-helm-charts cancel-in-progress: false - if: ${{ github.env.IS_RELEASE != 'true' }} permissions: packages: write runs-on: ubuntu-latest