Skip to content

Commit 1d7d9c3

Browse files
authored
Merge pull request #68 from Arbuzov/codex/fix-unbound-variable-error-in-chart-release-u57kln
ci: avoid chart-releaser skip-packaging failures on reupload
2 parents c796774 + 6d0afe9 commit 1d7d9c3

File tree

1 file changed

+31
-18
lines changed

1 file changed

+31
-18
lines changed

.github/workflows/chart-release.yml

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,28 @@ jobs:
129129
bash "${GITHUB_WORKSPACE}/.github/scripts/package_charts.sh" \
130130
"charts" "${{ github.event.inputs.chart }}"
131131
132+
- name: Run chart-releaser (reupload)
133+
if: >-
134+
${{ github.event.inputs.action == 'reupload'
135+
&& (github.event.inputs.chart == 'all'
136+
|| github.event.inputs.chart == 'mcp-library') }}
137+
env:
138+
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139+
run: |
140+
owner="${GITHUB_REPOSITORY%%/*}"
141+
repo="${GITHUB_REPOSITORY##*/}"
142+
rm -rf .cr-index
143+
mkdir -p .cr-index
144+
cr upload --owner "${owner}" --repo "${repo}" --commit "$(git rev-parse HEAD)" --pages-branch gh-pages
145+
cr index --owner "${owner}" --repo "${repo}" --push --pages-branch gh-pages
146+
132147
- name: Run chart-releaser
133148
id: cr
134149
uses: helm/chart-releaser-action@v1.7.0
135-
if: >-
136-
${{ github.event.inputs.action != 'reupload'
137-
|| github.event.inputs.chart == 'all'
138-
|| github.event.inputs.chart == 'mcp-library' }}
150+
if: ${{ github.event.inputs.action != 'reupload' }}
139151
with:
140152
charts_dir: charts
141153
pages_branch: gh-pages
142-
mark_as_latest: false
143-
skip_packaging: >-
144-
${{ github.event.inputs.action == 'reupload'
145-
&& (github.event.inputs.chart == 'all'
146-
|| github.event.inputs.chart == 'mcp-library')
147-
&& 'true' || '' }}
148154
skip_existing: false
149155
env:
150156
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -196,19 +202,26 @@ jobs:
196202
bash "${GITHUB_WORKSPACE}/.github/scripts/package_charts.sh" \
197203
"charts" "${{ github.event.inputs.chart }}"
198204
205+
- name: Run chart-releaser (reupload)
206+
if: >-
207+
${{ github.event.inputs.action == 'reupload'
208+
&& github.event.inputs.chart != 'mcp-library' }}
209+
env:
210+
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
211+
run: |
212+
owner="${GITHUB_REPOSITORY%%/*}"
213+
repo="${GITHUB_REPOSITORY##*/}"
214+
rm -rf .cr-index
215+
mkdir -p .cr-index
216+
cr upload --owner "${owner}" --repo "${repo}" --commit "$(git rev-parse HEAD)" --pages-branch gh-pages
217+
cr index --owner "${owner}" --repo "${repo}" --push --pages-branch gh-pages
218+
199219
- name: Run chart-releaser
200220
uses: helm/chart-releaser-action@v1.7.0
201-
if: >-
202-
${{ github.event.inputs.action != 'reupload'
203-
|| github.event.inputs.chart != 'mcp-library' }}
221+
if: ${{ github.event.inputs.action != 'reupload' }}
204222
with:
205223
charts_dir: charts
206224
pages_branch: gh-pages
207-
mark_as_latest: false
208-
skip_packaging: >-
209-
${{ github.event.inputs.action == 'reupload'
210-
&& github.event.inputs.chart != 'mcp-library'
211-
&& 'true' || '' }}
212225
skip_existing: false
213226
env:
214227
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)