Skip to content

Commit a0190bd

Browse files
chore(chart): fixing gh action issues reloader chart to 0.1.5
1 parent 14d9a14 commit a0190bd

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

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

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,30 @@ jobs:
8484
set -euo pipefail
8585
SAFE="${{ steps.branch.outputs.safe }}"
8686
CHART_VERSION="${{ steps.branch.outputs.chart_version }}"
87-
# After chart-releaser action, gh-pages is already updated locally
88-
git checkout gh-pages
87+
ORIG_BRANCH="${GITHUB_REF_NAME}"
88+
WORKDIR=$(pwd)
89+
TMPDIR=$(mktemp -d)
90+
# Collect artifacts produced on source branch before switching
91+
[ -f index.yaml ] && mv index.yaml "$TMPDIR/index.yaml" || true
92+
for f in *.tgz; do
93+
[ -f "$f" ] && mv "$f" "$TMPDIR/" || true
94+
done
95+
# Switch to gh-pages safely (no untracked artifact conflicts)
96+
git checkout gh-pages || git checkout --track origin/gh-pages
8997
git fetch origin gh-pages
90-
# Fast-forward or align to remote to avoid non-fast-forward push errors
9198
git reset --hard origin/gh-pages
9299
mkdir -p branches/$SAFE
93-
if [ -f index.yaml ]; then
94-
cp index.yaml branches/$SAFE/index.yaml
95-
fi
96-
for f in *.tgz; do
97-
[ -f "$f" ] || continue
98-
cp "$f" branches/$SAFE/
100+
# Copy artifacts into branch-specific folder
101+
[ -f "$TMPDIR/index.yaml" ] && cp "$TMPDIR/index.yaml" branches/$SAFE/index.yaml || true
102+
for f in "$TMPDIR"/*.tgz; do
103+
[ -f "$f" ] && cp "$f" branches/$SAFE/ || true
99104
done
100105
git add branches/$SAFE
101106
git commit -m "Branch chart repo for $SAFE (version $CHART_VERSION)" || echo "Nothing new to commit"
102107
git push origin gh-pages
103-
git checkout "${GITHUB_REF_NAME}"
108+
# Cleanup and return to original branch
109+
rm -rf "$TMPDIR"
110+
git checkout "$ORIG_BRANCH"
104111
105112
# - name: Notify Slack
106113
# uses: 8398a7/action-slack@v3

deployments/kubernetes/chart/reloader/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: reloader
33
description: Reloader chart that runs on kubernetes
4-
version: 0.1.4
4+
version: 0.1.5
55
appVersion: v1.4.10
66
keywords:
77
- Reloader

0 commit comments

Comments
 (0)