Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only update krew index for latest stable version. #5224

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,22 @@ jobs:
base64-subjects: "${{ needs.sbom-assests.outputs.hashes }}"
provenance-name: "karmada-sbom.intoto.jsonl"
upload-assets: true

update-krew-index:
needs: release-assests
needs:
- release-assests
name: Update krew-index
runs-on: ubuntu-22.04
steps:
- name: get latest tag
id: get-latest-tag
run: |
export LATEST_TAG=`gh api repos/karmada-io/karmada/releases/latest | jq -r '.tag_name'`
echo "Got the latest tag:$LATEST_TAG"
echo "event.tag:"${{ github.event.release.tag_name }}
echo "latestTag=$LATEST_TAG" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
if: steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name
- name: Update new version in krew-index
if: steps.get-latest-tag.outputs.latestTag == github.event.release.tag_name
Comment on lines 217 to +220
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two steps were skipped, I don't know if this workflow could get the right latest tag, maybe there is a syntax error?
https://github.com/karmada-io/karmada/actions/runs/10645084310/job/29510560441#step:3:3

I can get the latest tag on my side.

# gh api repos/karmada-io/karmada/releases/latest | jq -r '.tag_name'
v1.11.0

uses: rajatjindal/[email protected]