plumed2
plumed2 copied to clipboard
Pushing docs for a private fork not working with Github Actions
I am trying to use Github Action to generate and push a manual from my PLUMED 2 fork, similar as I have done using Travis in the past.
I generated the git token for the bot and have added the relevant variables under settings/secrets (GIT_TOKEN, GIT_BOT, GIT_BOT_EMAIL) in the "Repository secrets" part. And have given the bot access to the target doc-XXX repo.
However, in the Github action log, I always get a message "No GIT_TOKEN, cannot push", indicating that Github Action is not seeing the environmental variable.
Do I need to add the GIT_TOKEN somewhere else? Under Organization secrets? Or do I need to give the doc access to my fork?
In this regards, we should also update the instructions at the end of https://www.plumed.org/doc-master/developer-doc/html/using_doxygen.html
I think I named the secret differently, should be GIT_TOKEN_PLUMEDBOT. Notice that if you need a secret as an env var you should import it as it is done here:
https://github.com/plumed/plumed2/blob/a522039a4be79323a385ef6ad5933b3a420e4cb7/.github/workflows/ci.yml#L127
And yes, it would be great if you could update the doc, thanks!!
Ah, I missed that, that makes sense.
However, won't the problem then be that GIT_BOT and GIT_BOT_EMAIL are not defined correctly? Should we not also take GIT_BOT and GIT_BOT_EMAIL from the secrets? And have in plumed2/.github/workflows/ci.yml:
GIT_TOKEN: ${{ secrets.GIT_TOKEN_PLUMEDBOT }} GIT_BOT: ${{ secrets.GIT_BOT }} GIT_BOT_EMAIL: ${{ secrets.GIT_BOT }}
Or should I define the GIT_BOT and GIT_BOT_EMAIL variables somewhere else in the repo settings? I can't another place
I will update the manual for this as soon as possible
Okay, setting GIT_TOKEN_PLUMEDBOT works, see https://github.com/ves-code/doc-irtg-school-2020 Only the commit is incorrectly labeled as being done by PlumedDot as the GIT_BOT variable is not picked up, I will try to fix that in the PR where I update the manual.
It seems that when adding the git remote only the git token is relevant while the user name does not matter https://github.com/plumed/plumed2/blob/a522039a4be79323a385ef6ad5933b3a420e4cb7/.travis/push#L145
On what branch should I do the changes to the manual? v2.5 or v2.6?
Thanks @GiovanniBussi!
I would suggest v2.6 is sufficient. Thanks a lot for sorting this out! Giovanni