Repository navigation
chore: add Dependabot with auto-merge via GitHub App #2
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: 'gradle' | ||
| directory: '/' | ||
| schedule: | ||
| interval: 'weekly' | ||
| open-pull-requests-limit: 10 | ||
|
|
||
| - package-ecosystem: 'github-actions' | ||
| directory: '/' | ||
| schedule: | ||
| interval: 'weekly' | ||
| open-pull-requests-limit: 10 | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| name: Dependabot auto-merge | ||||||
|
|
||||||
| on: | ||||||
| pull_request_target: | ||||||
| branches: | ||||||
| - main | ||||||
|
Comment on lines
+3
to
+6
|
||||||
|
|
||||||
| permissions: | ||||||
| contents: write | ||||||
| pull-requests: write | ||||||
|
|
||||||
| jobs: | ||||||
| dependabot: | ||||||
| runs-on: ubuntu-latest | ||||||
| if: github.event.pull_request.user.login == 'dependabot[bot]' | ||||||
| steps: | ||||||
| - name: Dependabot metadata | ||||||
| id: metadata | ||||||
| uses: dependabot/fetch-metadata@v2 | ||||||
| with: | ||||||
| github-token: '${{ secrets.GITHUB_TOKEN }}' | ||||||
|
|
||||||
| - name: Generate app token | ||||||
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.dependency-type == 'indirect' | ||||||
|
Comment on lines
+23
to
+24
|
||||||
| id: app-token | ||||||
| uses: actions/create-github-app-token@v1 | ||||||
| with: | ||||||
| app-id: ${{ secrets.APP_ID }} | ||||||
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||||||
|
|
||||||
| - name: Approve and auto-merge | ||||||
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.dependency-type == 'indirect' | ||||||
| run: | | ||||||
| gh pr review --approve "$PR_URL" | ||||||
| gh pr merge --squash --admin "$PR_URL" | ||||||
|
||||||
| gh pr merge --squash --admin "$PR_URL" | |
| gh pr merge --auto --squash "$PR_URL" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependabot is configured for
package-ecosystem: 'gradle'in the repository root (directory: '/'), but there are no Gradle manifests at the repo root (e.g.build.gradle,build.gradle.kts,settings.gradle). This will cause Dependabot runs to fail with “manifest not found”. Either remove the Gradle entry or pointdirectoryat the folder that actually contains the Gradle project.