Skip to content

Commit

Permalink
.github: fix 'v'-tag-is-release logic.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
klihub committed Apr 4, 2024
1 parent 064cf5e commit 069263e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/package-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ 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 }}
REGISTRY_PATH: ${{ github.repository }}

jobs:
release:
if: ${{ github.env.IS_RELEASE == 'true' }}
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
permissions:
contents: write
runs-on: ubuntu-latest
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 069263e

Please sign in to comment.