codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 1 forks source link

Tweak how CLI gets the branch name for tokenless #2065

Open matt-codecov opened 2 months ago

matt-codecov commented 2 months ago

Currently the GHA will set a $TOKENLESS env var and the CLI will read from it.

If there's no token and $TOKENLESS is not set, the CLI will error out. That means you can't use the normal way to override the branch (-B) for tokenless, you need a unique way just for this case. That's kind of counterintuitive.

IMO, we could get rid of the $TOKENLESS env var and make the GHA just use -B, and then change the CLI logic to be:

if not token and ':' not in branch:
    print("nuh-uh")

(Alternatively, we could make the CLI figure out the unprotected branch name on its own)

matt-codecov commented 2 weeks ago

@joseph-sentry @trent-codecov could we try to close this issue by finishing https://github.com/codecov/codecov-cli/pull/475 and https://github.com/codecov/codecov-action/pull/1511 next sprint?