[Question] Why use GITHUB_TOKEN as repo_token?
https://docs.coveralls.io/parallel-build-webhook In the API reference page, the format of API call is like the following
curl -k $COVERALLS_ENDPOINT/webhook?repo_token=$COVERALLS_REPO_TOKEN
-d "payload[build_num]=$BUILD_NUMBER&payload[status]=done"
I don't understand why in this github-action, we can use GITHUB_TOKEN instead of the REPO_TOKEN in the coveralls.io repository page? Could you explain to us? Thank you.
It doesn't need to be "GITHUB_TOKEN". It's whatever name you assign it as a Github Secret. The example just uses "GITHUB_TOKEN" but you are welcome to use whatever name you want.
Hi @jamesdh , I guess you misunderstood my question... In other words, what's the role of "COVERALLS_REPO_TOKEN" generated by coveralls.io?
It's your Coveralls API token. You need it to verify who you are with Coveralls. Without it, they don't know who you are pushing data to them as.
It's the same thing as "REPO_TOKEN". You can give it whatever name you want. It's just a variable name. The only thing that matters is the value of the token it contains.
Right. But "COVERALLS_REPO_TOKEN" doesn't have the same value as my "GITHUB_TOKEN".
I have the same question and maybe can clarify what (I think) @changhuixu was asking — why does passing the GITHUB_TOKEN provided by GitHub Actions work as the COVERALLS_REPO_TOKEN?
Based on how I'm reading the API reference this token eventually gets passed as repo_token and that should be coming from Coveralls, not GitHub.
@jamesdh Which GitHub API endpoint does Coveralls use to verify who you are? That will tell me what permissions are required.
I was curious about this question so I tested out coveralls API: https://docs.coveralls.io/api-reference
When the service_name field is passed as github then coveralls expects the repo_token field to be a github token so that it can directly call back to github. In fact, in such a case, using a legit coveralls repo token will result in a failure unless the service_name field is changed to something else.
Here's an example for how I am using this action for parallel-finished in tandem with the python-coveralls: https://github.com/praw-dev/prawtools/commit/bb0e00b89a899fb2494cf230c0104746ddaeb098