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 75 forks source link

[semver:patch] Fix improperly dereferenced variable for GitHub #114

Closed robzr closed 3 years ago

robzr commented 3 years ago

Checklist

Motivation, issues

The variable handling for BOT_TOKEN was broken in the post-pr-comment command, when using this with dev-promote-from-commit-subject and parameter add-pr-comment: true, the step Post comment to GitHub pull request would show a failed curl api call:

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/issues#create-an-issue-comment"
}

Traced this to the BOT_TOKEN environment variable not being dereferenced properly.

Description

Removed the extraneous $ prefix on the environment value; and added a bash dereference modifier (${!) to the script, tested (it works). Not sure what the point of the interim BOT_TOKEN environment variable was at all, instead of simply passing the << parameter.bot-token-variable >> right into the curl call, but I left it.

gmemstr commented 3 years ago

Interesting. I guess this is why that call never worked. Reviewing this now :)