Skip to content

Commit 5a9ba0e

Browse files
committed
ci(helm): harden manual dispatch + skip PR checks for helm-only changes
- override appVersion via yq + env (no sed escape issues for user input) - fall back REF_SLUG to 'manual' when sanitization strips it empty - ignore helm prerelease workflow files in pr_checks.yml so unrelated CI edits don't trigger the full typecheck/unit/e2e suite
1 parent c44257d commit 5a9ba0e

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/helm-prerelease.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ jobs:
113113
else
114114
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
115115
REF_SLUG=$(echo "${{ github.ref_name }}" | tr '/' '-' | tr -cd 'a-zA-Z0-9-')
116+
if [[ -z "$REF_SLUG" ]]; then
117+
REF_SLUG="manual"
118+
fi
116119
PRERELEASE_VERSION="${BASE_VERSION}-${REF_SLUG}.${SHORT_SHA}"
117120
fi
118121
echo "version=$PRERELEASE_VERSION" >> $GITHUB_OUTPUT
@@ -124,8 +127,10 @@ jobs:
124127
125128
- name: Override appVersion
126129
if: github.event_name == 'workflow_dispatch' && inputs.app_version != ''
130+
env:
131+
APP_VERSION: ${{ inputs.app_version }}
127132
run: |
128-
sed -i "s/^appVersion:.*/appVersion: ${{ inputs.app_version }}/" ./hosting/k8s/helm/Chart.yaml
133+
yq -i '.appVersion = strenv(APP_VERSION)' ./hosting/k8s/helm/Chart.yaml
129134
130135
- name: Package Helm Chart
131136
run: |

.github/workflows/pr_checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- "docs/**"
88
- ".changeset/**"
99
- "hosting/**"
10+
- ".github/workflows/helm-prerelease.yml"
11+
- ".github/workflows/helm-pr-prerelease.yml"
1012

1113
concurrency:
1214
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

0 commit comments

Comments
 (0)