From 3e5386d8ff2286b32621f0842da133186f20ff71 Mon Sep 17 00:00:00 2001 From: Xudong Liu Date: Thu, 7 Mar 2024 15:07:42 +0800 Subject: [PATCH] Update bump-k8s.yml --- .github/workflows/bump-k8s.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/bump-k8s.yml b/.github/workflows/bump-k8s.yml index 65ed39c26..741da00cf 100644 --- a/.github/workflows/bump-k8s.yml +++ b/.github/workflows/bump-k8s.yml @@ -1,14 +1,10 @@ name: Bump latest Kubernetes dependecies on: - push: - branches: - - main - schedule: - - cron: '0 0 * * *' # Run daily at midnight + - cron: '0 0 */2 * *' # Run every two days at UTC midnight - workflow_dispatch: + workflow_dispatch: # Use for manaully trigger to debug jobs: bump-to-latest-pre-release: @@ -21,29 +17,29 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version-file: 'go.mod' - name: Bump latest k8s.io dependencies run: bash ./hack/bump-k8s-dep.sh - name: Configure Git run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + git config user.name "github-actions[bot]" + git config user.email "github-actions-bot@example.com" - - name: Check for changes + - name: Check for changes and update version id: changes run: | - echo "::set-output name=changes::$(git diff)" + echo "changes=$(git diff)" >> $GITHUB_OUTPUT - name: Create PR if: steps.changes.outputs.changes run: | - HEAD_BRANCH="auto-bump-$(date +'%Y%m%d%H%M%S')" + HEAD_BRANCH="github-actions/auto-bump/k8s-dependencies-$(date +'%Y%m%d%H%M%S')" git checkout -b "$HEAD_BRANCH" git add go.mod go.sum - git commit -sm "Bump the Kubernetes group updates" + git commit -sm "Bump Kubernetes group dependencies updates" git push origin "$HEAD_BRANCH" - gh pr create --base master --title ":seedling: Bump the Kubernetes group updates" --label "ok-to-test" --body "This is an automated pull request generated to bump the latest k8s dependencies." + gh pr create --base master --title ":seedling: Bump the Kubernetes group updates " --body "This is an automatically generated pull request to bump the latest k8s dependencies." env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}