Repository navigation
Streamline Dependabot pull requests #347
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
043a6ef
Group Dependabot updates into one monthly PR
camUrban 2d2ba35
Assign grouped Dependabot PRs to the maintainer
camUrban 48fd06e
Shorten Dependabot PR titles with a workflow
camUrban f6567cb
Configure labels and assignee for pip security PRs
camUrban 913850c
Set milestones on Dependabot PRs automatically
camUrban 3b74739
Prevent milestone overwrite if already set
camUrban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,31 @@ | ||
| version: 2 | ||
| multi-ecosystem-groups: | ||
| ci-tooling: | ||
| schedule: | ||
| interval: monthly | ||
| assignees: | ||
| - camUrban | ||
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| patterns: | ||
| - "*" | ||
| multi-ecosystem-group: ci-tooling | ||
| cooldown: | ||
| default-days: 7 | ||
| groups: | ||
| actions: | ||
| patterns: | ||
| - "*" | ||
| - package-ecosystem: pre-commit | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| patterns: | ||
| - "*" | ||
| multi-ecosystem-group: ci-tooling | ||
| cooldown: | ||
| default-days: 7 | ||
| groups: | ||
| pre-commit: | ||
| patterns: | ||
| - "*" | ||
| - package-ecosystem: pip | ||
| directory: / | ||
| schedule: | ||
| interval: monthly | ||
| open-pull-requests-limit: 0 | ||
| labels: | ||
| - dependencies | ||
| assignees: | ||
| - camUrban |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: dependabot-triage | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| dependabot-triage: | ||
| if: github.event.pull_request.user.login == 'dependabot[bot]' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Shorten the pull request title | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| run: | | ||
| non_ci_files=$(gh pr view "$PR_URL" --json files --jq '[.files[].path | select(startswith(".github/") or . == ".pre-commit-config.yaml" | not)] | length') | ||
| if [ "$non_ci_files" -eq 0 ]; then | ||
| title="Bump CI tooling" | ||
| else | ||
| dependency_count=$(gh pr view "$PR_URL" --json commits --jq '[.commits[] | select(any(.authors[]; .login == "dependabot[bot]")) | .messageBody | split("\n")[] | select(startswith("- dependency-name: "))] | unique | length') | ||
| if [ "$dependency_count" -eq 1 ]; then | ||
| title="Bump runtime dependency" | ||
| else | ||
| title="Bump runtime dependencies" | ||
| fi | ||
| fi | ||
| gh pr edit "$PR_URL" --title "$title" | ||
| - name: Set the milestone to the lowest open release | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| has_milestone=$(gh pr view "$PR_URL" --json milestone --jq '.milestone != null') | ||
| if [ "$has_milestone" = "true" ]; then | ||
| exit 0 | ||
| fi | ||
| milestone=$(gh api "repos/$REPO/milestones?state=open&per_page=100" --jq '[.[].title | select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+$"))] | sort_by(ltrimstr("v") | split(".") | map(tonumber)) | first // empty') | ||
| if [ -n "$milestone" ]; then | ||
| gh pr edit "$PR_URL" --milestone "$milestone" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.