fix(github): use the same coveralls token in both halves of the coverage run - #52
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Coveralls needs two halves to work across a Node matrix: each version uploads its own report with
parallel: true, and one final job closes the build off withparallel-finished: true. Both need a token, and the two halves were reading different ones.Only
tokenis declared in thesecrets:block. So the upload half read the run's automatic token and ignored anything the caller passed, while the closing half read only the caller's.Why nothing is broken today
Every repository that sets
enable_coverage: truealso happens to pass the token explicitly:That is true of
homebridge,HAP-NodeJS,hap-client,homebridge-config-ui-x,bonjourandciao— all six. Both expressions therefore resolve to the same value, andcollect_coverage_reportsis passing on the most recenthomebridgeNode Build.Why it is still worth changing
It is a trap for the next caller. Enable coverage and forget the
secrets:block, and:Silent, and the green ticks point away from the cause.
The change
Both halves now read the same expression:
This is the pattern already used in
stale.ymlandlabeler.ymlafter #50, for the same reason. A caller that passestokenhas it honoured in both places — which it was not before, on the upload side. A caller that omits it gets the workflow's own token in both places, rather than one of each.No behaviour changes for the six repositories above: they pass
secrets.GITHUB_TOKEN, which is what the fallback resolves to anyway.