eddiewebb / circleci-queue

CircleCI orb to block/queue jobs to enforce max concurrency limits
MIT License
74 stars 75 forks source link

[3.1.2] Error "Required MY_BRANCH not found!" when running on a pipeline triggered by a tag #126

Closed jrnail23 closed 7 months ago

jrnail23 commented 7 months ago

Orb version

3.1.2

What happened

Running on a pipeline triggered by a tag (we use tags to trigger our release/deployment pipelines), so CIRCLE_BRANCH is empty, with the following params:

steps:
  - queue/until_front_of_line:
      tag-pattern: /^@my-org/my-app@\d+\.\d+\.\d+.*/
      my-pipeline: <<pipeline.number>>

Validation in load_variables is throwing the following: 

Block: false
environment: line 29: MY_BRANCH: Required MY_BRANCH not found! This is likely a bug in orb, please report.

Exited with code exit status 127
CircleCI received exit code 127

Expected behavior

I guess I expected it to work? 😛 Seriously though, when CIRCLE_TAG is present, CIRCLE_BRANCH will always be empty, so maybe don't make the branch required in that case?

eddiewebb commented 7 months ago

@jrnail23 - thanks versions 3.1.3 and 3.1.4 (docs change) should fix this.

jrnail23 commented 7 months ago

Wow, that was quick -- thanks!