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 3b0a2fe commit e14be3b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/bump-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ jobs:
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
HEAD_BRANCH="topic/github-actions/auto-bump/k8s-dependencies-$LATEST_VERSION"
echo "head_branch=$HEAD_BRANCH" >> $GITHUB_OUTPUT
echo "exist=$(git ls-remote --exit-code origin refs/heads/$HEAD_BRANCH)" >> $GITHUB_OUTPUT
- name: Create PR
if: steps.changes.outputs.changes && steps.exist.outputs.exist
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')"
HEAD_BRANCH=${{ steps.exist.outputs.head_branch }}
git checkout -b "$HEAD_BRANCH"
git add go.mod go.sum
git commit -sm "Bump Kubernetes group dependencies updates"
Expand Down

0 comments on commit e14be3b

Please sign in to comment.