-
Notifications
You must be signed in to change notification settings - Fork 25
Add dependabot rules for datacommonsorg/tools #343
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
base: master
Are you sure you want to change the base?
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,35 @@ | ||
| name: Dependabot Approval | ||
| on: pull_request | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| dependabot: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'datacommonsorg/olympics' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/olympics/tools |
||
| steps: | ||
| - name: Dependabot metadata | ||
| id: metadata | ||
| uses: dependabot/fetch-metadata@v2 | ||
|
|
||
| - name: Enable auto-merge for Dependabot PRs | ||
| run: gh pr merge --auto --merge "$PR_URL" | ||
| env: | ||
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
| PR_URL: ${{github.event.pull_request.html_url}} | ||
|
|
||
| - name: Comment and approve patch or minor updates | ||
| if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider adding a week of "bake time" so we are resilient to bad patches (the waiting time allows for maturity and other fixes to be applied to bad patches) |
||
| run: gh pr review $PR_URL --approve -b "Approving pull request because it includes a **patch or minor update**" | ||
| env: | ||
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
| PR_URL: ${{github.event.pull_request.html_url}} | ||
|
|
||
| - name: Comment and defer for major updates | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider adding a label as well, so it's easy to see the status on the open pr list |
||
| if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major'}} | ||
| run: gh pr comment $PR_URL --body "Not auto-approving this pull request because it includes a **major update**" | ||
| env: | ||
| PR_URL: ${{github.event.pull_request.html_url}} | ||
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
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.
scope this to the main branch