Skip to content

Commit 710bf12

Browse files
committed
Document merge-dependabot-pr.yml
1 parent 1d13feb commit 710bf12

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,25 @@ See its documentation for labeling convention and respective GitHub events for c
112112
#### Backport Issue caller workflow example:
113113
https://github.com/artembilan/spring-github-workflows/blob/78b29123a17655f019d800690cc906d692f836a9/samples/backport-issue.yml#L1-L16
114114

115+
## Dependabot Support
116+
117+
If [Dependabot](https://github.com/dependabot) is enabled for repository, its config should set a label compatible with [Spring Changelog Generator](https://github.com/spring-io/github-changelog-generator).
118+
Typically, it is `type: dependency-upgrade`.
119+
It is also a good practice to group all the development dependencies into a single pull request from Dependabot.
120+
This includes all the Gradle and Maven plugins and those dependencies which are used only for testing in the project.
121+
This projects provides a [spring-merge-dependabot-pr.yml](.github/workflows/spring-merge-dependabot-pr.yml) reusable workflow to make modifications to the Dependabot pull requests.
122+
However, there are some prerequisites to use this workflow in your project:
123+
- Pull requests must be protected by some check to pass, usually a workflow to build the project with this pull request changes;
124+
- The [auto-merge](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository) must be enabled in the repository;
125+
126+
The `spring-merge-dependabot-pr` workflow does these modifications to the Dependabot pull requests:
127+
- Modify label from `dependency-upgrade` to the `task` for the development dependencies group update to skip them from release notes by Spring Changelog Generator;
128+
- Adds a currently scheduled milestone to the pull request against a snapshot version extracted from the target branch;
129+
- And if milestone is scheduled, the pull request is queued for auto-merging after required checks have passed.
130+
131+
#### Dependabot merge pull request workflow example:
132+
https://github.com/artembilan/spring-github-workflows/blob/78b29123a17655f019d800690cc906d692f836a9/samples/backport-issue.yml#L1-L16
133+
115134
## Gradle and Artifactory
116135

117136
Gradle projects must not manage `com.jfrog.artifactory` plugin anymore: the `jf gradlec` command sets up this plugin and respective tasks into a project using JFrog specific Gradle init script.

samples/merge-dependabot-pr.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ run-name: Merge Dependabot PR ${{ github.ref_name }}
99

1010
jobs:
1111
merge-dependabot-pr:
12-
permissions:
13-
actions: write
14-
contents: write
15-
issues: write
12+
permissions: write-all
1613

1714
uses: artembilan/spring-github-workflows/.github/workflows/spring-merge-dependabot-pr.yml@main

0 commit comments

Comments
 (0)