CircleCI-Public / heroku-orb

Easily install and use the Heroku CLI with CircleCI to build, test, and deploy your applications to Heroku.
https://circleci.com/orbs/registry/orb/circleci/heroku
MIT License
6 stars 20 forks source link

[semver:patch] allow tag deployments by using full path refs #12

Closed a14m closed 4 years ago

a14m commented 4 years ago

This edit is just more verbose about which reference is being pushed and to which remote

\<refspec>: If \<dst> doesn’t start with refs/ (e.g. refs/heads/master) we will try to infer where in refs/* on the destination \<repository> it belongs based on the type of \<src> being pushed and whether \<dst> is ambiguous. If \<dst> unambiguously refers to a ref on the \<repository> remote, then push to that ref.

Ref: https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-push.html

The added benefit of this edit is that we can now deploy both branches and tags based on the definition of the parameters.branch

ex:

Fixes: https://github.com/CircleCI-Public/heroku-orb/issues/7 Safer than https://github.com/CircleCI-Public/heroku-orb/pull/8

As when a new repo is created on heroku, the command used in https://github.com/CircleCI-Public/heroku-orb/pull/8 would fail with the following error

hint: The <src> part of the refspec is a commit object.
hint: Did you mean to create a new branch by pushing to
hint: 'v2.0.0^{}:refs/heads/master'?

Backward compatible but the naming of the variable could be changed in a later release to indicate that it's taking a reference path to deploy on the refs/heads/main heroku branch

gmemstr commented 4 years ago

We're opting to use #8, as it's a nicer end-user experience for the orb.