From a09008c487d4e1d24d38db869f9a440189c5f3f4 Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Mon, 31 Jul 2023 16:25:39 +0900 Subject: [PATCH] Add dependabot and auto hack scripts --- .github/dependabot.yml | 13 ++++++++ .github/workflows/knative-dependabot.yaml | 38 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/knative-dependabot.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..5505b72e0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + ignore: + - dependency-name: "k8s.io/*" + - dependency-name: "knative.dev/*" diff --git a/.github/workflows/knative-dependabot.yaml b/.github/workflows/knative-dependabot.yaml new file mode 100644 index 000000000..bd68ba052 --- /dev/null +++ b/.github/workflows/knative-dependabot.yaml @@ -0,0 +1,38 @@ +name: dependabot - hack scripts + +on: + pull_request: + +permissions: + contents: write + +jobs: + generate_some_code: + name: update deps + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + path: ./src/github.com/${{ github.repository }} + fetch-depth: 0 + + - name: Run hack scripts + working-directory: ./src/github.com/${{ github.repository }} + run: | + ./hack/update-deps.sh + ./hack/update-codegen.sh + + - name: git push + working-directory: ./src/github.com/${{ github.repository }} + run: | + if ! git diff --exit-code --quiet + then + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add . + git commit -m "Run ./hack/update-codegen.sh" + git push + fi