Updates config/projects.json in the spring-cloud-github-actions repository
when a new commercial branch is initialized. Designed to run as part of the
initialize-commercial-branch workflow.
The project entry is located using the OSS repository name (org prefix and
-commercial suffix are stripped). If no project-specific entry exists the
defaults entry is used instead.
For the resolved project the action:
- Adds the new commercial branch to
commercial.branches.scheduled. - Optionally updates
commercial.branches.defaultto the new branch whenset-default-branchistrue. - Copies
jdkVersionsfrom the OSS entry into thecommercialsection, resolving hotfix branches against their parent branch. - Removes the OSS branch from the OSS entry (skipped for hotfix branches).
- Commits the updated
projects.jsonto themainbranch ofspring-cloud-github-actionswith the message:Update projects.json: add <project> commercial branch <branch>
No commit is made if the JSON is unchanged.
| Name | Required | Default | Description |
|---|---|---|---|
oss-repo |
yes | — | OSS repository (org/repo-name) |
oss-branch |
no | '' |
OSS branch being copied. Leave empty for hotfix branches (use oss-tag instead). |
commercial-branch |
yes | — | New commercial branch name |
set-default-branch |
no | false |
Set to true to update commercial.branches.default to the new branch |
token |
yes | — | GitHub token with contents: write on spring-cloud-github-actions |
- name: Update projects.json
uses: spring-cloud/spring-cloud-github-actions/.github/actions/update-projects-json@main
with:
oss-repo: spring-cloud/spring-cloud-build
oss-branch: 4.3.x
commercial-branch: 4.3.x
set-default-branch: 'true'
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}The action logic lives in src/index.js and is bundled with ncc into dist/index.js. The bundle must be committed alongside any source changes.
# Install dependencies
npm install
# Run tests
npm test
# Rebuild the bundle after editing src/index.js or package.json
npm run buildretire-branch-projects-json— removes a branch fromprojects.jsonwhen it is retired