CircleCI-Public / orb-tools-orb

Various tools for authoring and publishing CircleCI orbs
https://circleci.com/orbs/registry/orb/circleci/orb-tools
MIT License
51 stars 74 forks source link

`add-pr-comment` posts `$PR_MESSAGE` instead of the actual PR message #121

Closed william-richard closed 2 years ago

william-richard commented 2 years ago

Hi there!

I tried setting up these orbs, and using the add-pr-comment parameter of dev-promote-prod-from-commit-subject. After my orb was released, it did post on my PR, but it posted the literal message $PR_MESSAGE instead of the intended text.

It looks like originally, the job to post to github was included in-line: https://github.com/CircleCI-Public/orb-tools-orb/pull/48/files#diff-fb366387fc25f0a7f13264f09741a3deda684c5ce175ae2f6247e20d4cb1b3b9R73

But at some point, it was split into its own job: https://github.com/CircleCI-Public/orb-tools-orb/pull/73/files#diff-a1e9004fe47111f4a7dea78b06d30b23c95ad601a27f29686fc1d6a1abcb3226R114

I'm pretty sure that circle does not source $BASH_ENV when its populating pipeline variables, so $PR_MESSAGE is not available to be passed as a parameter to the post-pr-comment step.

I think I understand the problem, but I'm not sure how to fix it. Making the post-pr-comment step in-line seems like a regression, so that doesn't seem like the right path. And implicitly passing the message we want via the $BASH_ENV seems like too much magic to me.

Maybe the PR comment should be the name of a variable to use, like how bot-token-variable works?