From 9c40c0de467b198a2a9be01e5f5b13fa16a5ac2b Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Wed, 3 Apr 2024 14:06:42 +0200 Subject: [PATCH] Add workflow to automatically update `schedule.yaml` Signed-off-by: Sascha Grunert --- .github/workflows/update-schedule.yml | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/update-schedule.yml diff --git a/.github/workflows/update-schedule.yml b/.github/workflows/update-schedule.yml new file mode 100644 index 0000000000000..5d6b5a95db22c --- /dev/null +++ b/.github/workflows/update-schedule.yml @@ -0,0 +1,49 @@ +name: Update schedule.yaml +on: + workflow_dispatch: + push: + branches: + - update-schedule-yaml + # schedule: + # - cron: '0 10 * * *' +jobs: + create-pull-request: + name: Create PR if required + # if: github.repository == 'kubernetes-sigs/downloadkubernetes' + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + fetch-depth: 0 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version: '1.22' + check-latest: true + - name: Install schedule-builder + run: go install k8s.io/release/cmd/schedule-builder@latest + + - name: Update schedule.yaml + run: | + schedule-builder --config-path data/releases/schedule.yaml + + #- name: Check workspace + # id: create_pr + # run: | + # if [[ $(git diff --stat) != '' ]]; then + # echo "create_pr=true" >> "$GITHUB_OUTPUT" + # fi + + #- name: Create Pull Request + # uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2 + # if: ${{ steps.create_pr.outputs.create_pr == 'true' }} + # with: + # token: ${{ secrets.GITHUB_TOKEN }} + # commit-message: update index + # title: 'Update index' + # body: > + # Update index + # labels: ok-to-test, feature, automated pr + # branch-suffix: timestamp + # branch: update-index + # delete-branch: true