Skip to content

Commit 067fd66

Browse files
fixing workflow issue
1 parent 880caa9 commit 067fd66

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/release-helm-chart-by-branch.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
- name: Ensure gh-pages branch exists
3434
shell: bash
3535
run: |
36+
set -euo pipefail
37+
SRC_BRANCH="${GITHUB_REF_NAME}"
3638
if ! git ls-remote --exit-code --heads origin gh-pages >/dev/null 2>&1; then
3739
echo "Initializing gh-pages branch"
3840
git checkout --orphan gh-pages
@@ -42,7 +44,9 @@ jobs:
4244
git add .nojekyll
4345
git commit -m "Initialize gh-pages for Helm chart index"
4446
git push origin gh-pages
45-
git checkout -
47+
# Switch back to the source branch explicitly
48+
git fetch origin "$SRC_BRANCH" --depth=1
49+
git checkout "$SRC_BRANCH"
4650
fi
4751
4852
- name: Compute branch-specific paths
@@ -63,7 +67,7 @@ jobs:
6367
- name: Release with chart-releaser (branch)
6468
uses: helm/chart-releaser-action@v1.6.0
6569
env:
66-
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
CR_TOKEN: ${{ github.token }}
6771
CR_PAGES_BRANCH: gh-pages
6872
CR_CHARTS_DIR: deployments/kubernetes/chart
6973
CR_SKIP_EXISTING: true

0 commit comments

Comments
 (0)