Skip to content

Commit

Permalink
improve actions
Browse files Browse the repository at this point in the history
Signed-off-by: xudong liu <[email protected]>
  • Loading branch information
XudongLiuHarold committed Mar 8, 2024
1 parent 502fc12 commit 3b0a2fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/bump-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ jobs:
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Check if update PR exist
id: exist
run: |
LATEST_VERSION=$(go list -m -versions -json "k8s.io/api" | jq -r '.Versions[-1]')
HEAD_BRANCH="github-actions/auto-bump/k8s-dependencies-$LATEST_VERSION"
echo "exist=$(gh repo view cloud-provider-vsphere --json branch --jq ".branches[].name | select(. == \"$HEAD_BRANCH\"))" >> $GITHUB_OUTPUT
- name: Create PR
if: steps.changes.outputs.changes
if: steps.changes.outputs.changes && steps.exist.outputs.exist
run: |
HEAD_BRANCH="github-actions/auto-bump/k8s-dependencies-$(date +'%Y%m%d%H%M%S')"
git checkout -b "$HEAD_BRANCH"
Expand Down
8 changes: 4 additions & 4 deletions hack/bump-k8s-dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ check_and_bump_dependency() {
# latest_stable_version=$(go list -m -u -json ${dep} | jq -r .Version)

# filter out the alpha release
if [[ $latest_version =~ alpha\.([0-9]+)$ ]]; then
echo -e "${BLUE} Skip auto bump for alpha release: [$dep@$latest_version]${RESET}"
return
fi
# if [[ $latest_version =~ alpha\.([0-9]+)$ ]]; then
# echo -e "${BLUE} Skip auto bump for alpha release: [$dep@$latest_version]${RESET}"
# return
# fi

# Bump the version if needed
if [ "$current_version" == "$latest_version" ]; then
Expand Down

0 comments on commit 3b0a2fe

Please sign in to comment.