community
community copied to clipboard
For deployments, use VELA_REPO_BRANCH instead of refs/heads/master by default
Description
If no ref
is provided for a deployment, use the $VELA_REPO_BRANCH
env var instead of the current refs/heads/master
Value
Usability is maintained for repos that change their default branch, e.g. from master
to main
.
Definition of Done
- When adding a deployment from the CLI or the web UI, and without specifying the
ref
, for the deployment to happen on the$VELA_REPO_BRANCH
ref.
Misc
Issue #325 seems related.
I believe this is dependent on https://github.com/go-vela/community/issues/325 which is addressed with https://github.com/go-vela/server/pull/706.
Once that PR has been merged, Vela should be in sync with the default branch settings for the repo on the GitHub side.
For the CLI, we'll add an extra API call to fetch the settings for the repo before adding the deployment.
NOTE: The above behavior will only occur if no
ref
is provided.
For the UI, we already fetch the repo settings so I don't think any extra effort is required.
this should help as well: https://github.com/go-vela/server/pull/961