Contents
The KBase Actions (workflows) are built under the assumption that:
- All work is performed in feature branches (with names matching JIRA or GitHub issue numbers)
- Feature branches are merged via pull requests to the
develop
branch - Pre-release code is merged to
main
/master
via a pull request - Semantic relesases are created with the GitHub Release process
- The branch rules below are enabled on the repo to prevent build failures
- Confirm that
pr_build.yml
andrelease-main.yml
exist in the.github/workflows/
directories of all active branches. - See New Repository and Existing Repository for instructions on how to enable these workflows.
To prevent failed build checks, two branch rules must be enabled on the new repo.
The following steps will allow a repo owner/admin to set up the needed protection rules:
- Navigate to the
Settings
tab in the repository. - Click the
Branches
option on the left link underCode and automation
. - Verify that the default branch is set to
develop
. - Under
Branch protection rules
, clickAdd rule
. - Under
Branch name pattern
, enterdevelop
. - Check the following boxes under
Protect matching branches
:- Require a pull request before merging
- Require approvals (1 approver is fine)
- Require status checks to pass before merging
- Require branches to be up to date before merging
- Click Create.
- Repeat steps 1-6 above, setting the
Branch name pattern
tomain
. - In addition, check the
Include administrators
checkbox.- This can be safely disabled by an admin during troublehooting, but should remain enabled during normal use.
- Click create.
Once a successful Pull Request has been created, and the pr_build.yml
workflow has completed, require the following specific status checks:
- On
develop
branch rule:build-develop-open / build-image
- On
main
branch rule:build-main-open / build-push-image
Before using these branch rules, please:
- Review the Development Workflow and Release Workflow
- File a request with the DevOps team (via Jira or Slack) to make any resulting images public.
|| Previous: Existing Repository || Home || Next: Development Workflow ||