Skip to content

Commit 96f5149

Browse files
authored
Merge pull request #5224 from liangyuanpeng/update_krew_stable
Only update krew index for latest stable version.
2 parents 2d92fed + 31177dd commit 96f5149

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,22 @@ jobs:
200200
base64-subjects: "${{ needs.sbom-assests.outputs.hashes }}"
201201
provenance-name: "karmada-sbom.intoto.jsonl"
202202
upload-assets: true
203+
203204
update-krew-index:
204-
needs: release-assests
205+
needs:
206+
- release-assests
205207
name: Update krew-index
206208
runs-on: ubuntu-22.04
207209
steps:
210+
- name: get latest tag
211+
id: get-latest-tag
212+
run: |
213+
export LATEST_TAG=`gh api repos/karmada-io/karmada/releases/latest | jq -r '.tag_name'`
214+
echo "Got the latest tag:$LATEST_TAG"
215+
echo "event.tag:"${{ github.event.release.tag_name }}
216+
echo "latestTag=$LATEST_TAG" >> "$GITHUB_OUTPUT"
208217
- uses: actions/checkout@v4
218+
if: steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name
209219
- name: Update new version in krew-index
220+
if: steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name
210221
uses: rajatjindal/[email protected]

0 commit comments

Comments
 (0)