Use Travis variable for Codacy token in Travis automation script#53
Use Travis variable for Codacy token in Travis automation script#53SuperKogito wants to merge 7 commits intourlstechie:masterfrom
Conversation
SuperKogito
commented
Apr 17, 2021
- This PR replaces the old public Codacy token with a Travis hidden variable including the new token value.
- The token is defined as an environment variable in Travis, #defining-variables-in-repository-settings.
- To see the results in Codacy, use this link: Codacy/urlchecker-python
|
I am still not done, I am actually testing here, because I am not sure about the correct syntax. |
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
=========================================
Coverage ? 76.76%
=========================================
Files ? 12
Lines ? 383
Branches ? 0
=========================================
Hits ? 294
Misses ? 89
Partials ? 0 Continue to review full report at Codecov.
|
|
@vsoch so far I tried different approaches and none worked? any idea what am I doing wrong here? do you think it is the syntax or something else? |
|
For GitHub actions? |
|
Oh for travis. You should be able to define it in Travis settings (secrets as they show) and then reference it as an environment variable. |
|
I'd probably encrypt it https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml |
| - "3.7" | ||
|
|
||
| env: | ||
| - CODACY_PROJECT_TOKEN=${CodacyToken} |
There was a problem hiding this comment.
From what I'm reading, I don't think this will work - you need to encrypt it https://docs.travis-ci.com/user/environment-variables/#encrypting-environment-variables
There was a problem hiding this comment.
okay, if that works, then that works!
There was a problem hiding this comment.
right now it is not, so I am trying to figure the syntax. The alternative you mention would require me to install travis-ci and before that gem and that's extra work I am trying to avoid.
There was a problem hiding this comment.
I just posted a question on it; maybe someone see what is missing.
There was a problem hiding this comment.
You could spin up a container if you don't want to install things on your host. I think the encrypted way is the right way to do it (at least what I did when I used travis) but I also think you're right that it should work the "easy" way too. I stopped using travis years ago so I don't know anymore.
There was a problem hiding this comment.
I will give it a shot tomorrow. Actually I found out that the previous Codacy token was useless since we were not using codacy for this project anymore. I am also moving away from Travis since I hit my limit number of runs there.
There was a problem hiding this comment.
<personal opinion> I think the project would be fine without it.
There was a problem hiding this comment.
I agree, if I cannot fix this, I will drop it. We already have codecov.