community icon indicating copy to clipboard operation
community copied to clipboard

For deployments, use VELA_REPO_BRANCH instead of refs/heads/master by default

Open JohnCgp opened this issue 3 years ago • 1 comments

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.

JohnCgp avatar Nov 01 '21 15:11 JohnCgp

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.

jbrockopp avatar Nov 15 '22 17:11 jbrockopp

this should help as well: https://github.com/go-vela/server/pull/961

wass3r avatar Sep 08 '23 03:09 wass3r