Skip to content

Commit 514dab2

Browse files
authored
Merge pull request #136 from jsknnr/dev
fix release charts action failing when there are no changes
2 parents f26e0f5 + 921bafe commit 514dab2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/release_charts.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ jobs:
2020
run: |
2121
git config --global user.name "github-actions[bot]"
2222
git config --global user.email "github-actions[bot]@users.noreply.github.com"
23+
2324
git clone https://github.com/jsknnr/helm-charts.git
2425
cd helm-charts/charts
26+
2527
[ ! -d "${{env.CHART_NAME}}" ] && mkdir "${{env.CHART_NAME}}"
2628
cp -r ../../helm/* ./"${{env.CHART_NAME}}"/
27-
git remote set-url origin 'https://${{secrets.ACTIONS_GITHUB_TOKEN}}@github.com/jsknnr/helm-charts.git'
29+
30+
git remote set-url origin "https://${{secrets.ACTIONS_GITHUB_TOKEN}}@github.com/jsknnr/helm-charts.git"
31+
2832
git add .
29-
git commit -m "Automated commit from GitHub Actions for ${{env.CHART_NAME}}"
30-
git push origin main
33+
34+
# Only commit if there are changes
35+
if git diff-index --quiet HEAD --; then
36+
echo "No changes to commit"
37+
else
38+
git commit -m "Automated commit from GitHub Actions for ${{env.CHART_NAME}}"
39+
git push origin main
40+
fi

0 commit comments

Comments
 (0)