Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dependabot and auto hack scripts #830

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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/*"
38 changes: 38 additions & 0 deletions .github/workflows/knative-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: dependabot - hack scripts
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be added to either actions or .github repo so that we can just sync the file across repos. Not everyone uses dependabot but there are a few that do and would benefit from it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I was hesitated to adding the common dependabot because some repo has their own dependabot like https://github.com/knative-extensions/eventing-kafka-broker/blob/main/.github/workflows/build-dependabot-pr.yaml
But I will add it to the common one.


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
Loading