Registers newly created release line branches in
config/projects.json, so scheduled builds start
covering them.
The mirror image of
retire-branch-projects-json, and it
resolves the project entry and section the same way. It takes the whole set of
branches for a release train at once: a train rollover touches ~30 repositories,
and doing this inside a matrix would have those jobs racing to push to this
repository's main.
For each addition, the project key comes from the repository name (org prefix and
-commercial suffix stripped) and the section from the suffix — commercial for
-commercial repositories, oss for everything else. Then:
- The branch is added to the front of
<section>.branches.scheduledif it is not already there. <section>.jdkVersions[branch]is set to a copy of the source branch's list, falling back to the section'sdefault, then to the matching section of the globaldefaultsentry, then to["17", "21"].branches.defaultis left alone. A new release line branch is a maintenance line; the branch it was cut from stays the default.- A project with no entry in
projects.jsongets one, deep-copied fromdefaults.<section>. It is copied rather than shared on purpose:update-projects-jsonhands out the shareddefaultsobject and then mutates it, silently rewriting the fallback every other project relies on.
Every step is a no-op when it has already been applied, so a re-run of a partially
successful rollout makes no commit. All the additions land as a single commit on
main.
| Name | Required | Default | Description |
|---|---|---|---|
additions |
yes | JSON array of {"repo": …, "branch": …, "sourceBranch": …}. sourceBranch defaults to main |
|
commit-message |
no | Update projects.json: register N new branch(es) |
Commit message |
dry-run |
no | false |
Write the file and capture the patch, commit and push nothing |
token |
yes | Token with contents: write on spring-cloud-github-actions |
| Name | Description |
|---|---|
changed |
true when projects.json was modified |
patch |
The diff of the staged change, empty when nothing changed |
- uses: ./.github/actions/add-branches-projects-json
with:
additions: >-
[{"repo":"spring-cloud/spring-cloud-config","branch":"5.0.x","sourceBranch":"main"}]
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}Used by setup-next-release-train.yml.
npm ci
npm test
npm run build # rebuilds dist/index.js — verify-dist.yml fails if it is not committed