Skip to content

Commit

Permalink
#patch: move dependabot.yaml to .github/
Browse files Browse the repository at this point in the history
Signed-off-by: circa10a <caleblemoine@gmail.com>
  • Loading branch information
circa10a committed Dec 2, 2024
1 parent 68079d5 commit b44cde3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: monthly
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
9 changes: 8 additions & 1 deletion .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: Dependabot auto-approve
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
Expand All @@ -13,11 +14,17 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ The default GitHub actions that come with this project has 1 setup requirement.
> This assumes your Docker Hub namespace matches your git repository namespace.
> Example: github.com/mynamespace/myrepo will push to mynamespace/myrepo on Docker Hub
1. Enable dependabot updates - Navigate to repository > Security > Code security > Grouped security updates > Enabled

### Initialize a new project

Use [gonew](https://pkg.go.dev/golang.org/x/tools/cmd/gonew) to initialize a new project from this template:
Expand Down
6 changes: 0 additions & 6 deletions dependabot.yaml

This file was deleted.

0 comments on commit b44cde3

Please sign in to comment.