Reputation: 1380
I was hoping I could just add travis.ci as a collaborator, but didn't find anything in that direction. Maybe it's a security measure because they don't want to leak their credentials in the virtual environment.
Other (unsatisfying) ideas:
Does anyone have a better idea?
Context: I'm publishing my project from travis.ci and it automatically assigns a new version number that's tracked as a git tag, e.g. v1.0.5
Without anything setup, it obviously fails due to missing permissions:
pushing to remote, using `git push origin v0.1.41`
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/mpollmeier/sbt-ci-release-early-usage.git/'
Upvotes: 0
Views: 683
Reputation: 3099
The reason behind that is kind of security related, but not in the way you described it. Public repos are - as the name suggests - public which means that anyone can pull changes but only selected people can push. Since Travis by default only pulls from the repo, there's no need for Travis to have special access rights.
If Travis would request write access anyway, many users would complain about not trusting Travis as it requests permission for things that it shouldn't do by default.
If you wish to grant Travis write access anyway, the only ways to do so are the ones you described in your question, but I'll summarize them for the sake of completeness (from most to less preferred):
Creating a separate account for Travis is only necessary if you wish to be able to separate your commits from the ones done by Travis, it doesn't add any layer of security though.
Regardless of what way you choose, encrypted information is secure by design. If someone submits a pull request and you enabled builds for pull requests, Travis will not share your encryption keys with the submitter (as stated in the docs).
Upvotes: 2
Reputation: 1380
I ended up using a github access token a of https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/, but I'm still keen to hear better alternatives...
Upvotes: 0