Duplicates the entries in a repository's Dependabot config that target one branch, retargeting the copies at a newly created branch, so Dependabot starts raising PRs against the new release line.
This is the inverse of what retire-branch.yml
does when a line is retired, and it edits the config in the same place: the
repository's default branch. Dependabot reads .github/dependabot.yml only from
there — a copy on any other branch is inert, which is what separates this action
from copy-dependabot-config.
- Clones the default branch and finds
.github/dependabot.ymlor.github/dependabot.yaml. With neither present it warns and exits 0. - If any entry already targets the new branch, it stops — this is what makes a re-run safe.
- Copies every entry that targets the source branch, with
target-branchset to the new branch. The originals are left exactly as they were.- When the source branch is the default branch, entries with no
target-branchare part of the set: an absenttarget-branchimplicitly means the default branch. Their copies get an explicit one. - The copies are produced by merging
{"target-branch": <new>}rather than assigning: insideyq's+=argument an assignment to a key the entry does not already have is silently dropped, which would leave those copies duplicating the originals verbatim.
- When the source branch is the default branch, entries with no
- Stages, captures the patch, then commits and pushes to the default branch.
A copied entry keeps the original's milestone. After a train rollover main's
milestone number belongs to the new branch's line, so the copy is right and
main's own entry is left pointing at the old milestone. Repointing it is a
manual follow-up.
| Name | Required | Default | Description |
|---|---|---|---|
repository |
yes | Repository whose config is updated (org/repo-name) |
|
new-branch |
yes | Branch the duplicated entries should target (e.g. 5.0.x) |
|
source-branch |
no | the default branch | Branch whose entries are duplicated |
commit-message |
no | Add Dependabot entries for <new-branch> |
Commit message |
git-user-name |
no | Spring Builds |
Git author name |
git-user-email |
no | svc.spring-builds@broadcom.com |
Git author email |
dry-run |
no | false |
Stage and capture the patch, commit and push nothing |
token |
yes | Token with contents: write on the repository |
| Name | Description |
|---|---|
changed |
true when entries were added |
patch-file |
Path to the captured diff, empty when nothing changed |
- uses: spring-cloud/spring-cloud-github-actions/.github/actions/add-dependabot-branch-entries@main
with:
repository: spring-cloud/spring-cloud-config
new-branch: 5.0.x
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}Used by setup-next-release-train.yml.