Hi team, do you have any plans to make `can-i-depl...
# pact-broker
t
Hi team, do you have any plans to make
can-i-deploy
work with
mainBranch
concept? something like
can-i-deploy -to-main-branch
Context: some of our projects use
master
as a default branch, and some
main
.
can-i-deploy -to master
fails for the latter, so we additionally tag contracts with
master
tag if their default branch is
main
. It looks hacky, and it might be an option on
can-i-deploy
instead.
r
Would it work for you if you could dynamically get the main/master branch name?
Copy code
git remote show origin | grep "HEAD branch" | awk '{print $NF}'
... works for me. So you could assign that to a variable etc...
πŸ‘ 1
m
Interesting. Is the intent behind this more of the β€œcan I merge?” scenario?
t
Is the intent behind this more of the β€œcan I merge?” scenario?
yeah-yeah, it’s about that
πŸ‘ 1
Would it work for you if you could dynamically get the main/master branch name?
@Roy Collings do you mean that I could check each pair/contract separately? like, depending on what their default/main branch is?
r
@Tatiana Shepeleva I mean whenever you want to use
... can-i-deploy .... -to-main-branch
you could instead do something like:
Copy code
MAIN=$(git remote show origin | grep "HEAD branch" | awk '{print $NF}')

# (whatever your command is)
pact-broker can-i-deploy .... -to $MAIN
πŸ‘ 1
☝️ 1
m
Awesome, do vote for the above feature then Tatiana πŸ™‚
πŸƒ 1