I am trying to use actions to generate a bunch of configuration files using Ansible, involving two different repos.
I have a first repo in my profile containing all the Ansible related stuff required to install this tool on a runner, do the job and generate the expected files from Jinja templates.
I also have a second repo in my profile which is supposed to hold the resulting files, pushed and versioned by the runner.
It is checked out in a specific directory on the runner, where the files generated by Ansible are temporarily stored.
So after executing the playbooks, I just have to commit and push all the modifications back to the repo.
Unfortunately, it’s not working as expected.
I get a 403 error “remote: User permission denied” from the destination repo.
With some checkout/generate/push from and to the same repo, I have no auth problem.
But I need to split generation and results so I have to use separate repos.
As I have not been able to clearly understand whether Gitea offers some access tokens for users, I am a bit stuck and have no futher idea.
I suppose, checkout action uses github.token as authentication token. AFAIK its implementation in gitea is currently limited. If this action allows you to pass custom token, you should create yourself a personal access token and save it to actions secrets (at group level, i suppose), then pass it via secrets context
I have tried using “token: ${{ github.token }}” option, but it’s giving the same error. By the way, how is this one defined ? I am not sure it even exists.
I don’t really understand how to create a PAT as mentioned for Github almost everywhere.
At profile level ( Settings/Applications/Manage Access Tokens) I have created a token named "GITEA_TOKEN " with all available permissions granted.
Now using “token: ${{ secrets.GITEA_TOKEN }}” does not change anything.
It’s how it works by default.
After you created access token, you have to put its value under actions->secrets tab in your profile (or in repository calling checkout). If you save it as MY_TOKEN (for example, the key may be different than the one you used when creating token itself), you can refer to it via token: ${{ secrets.MY_TOKEN }}