Hi,
I have created several personal repos containing actions, managing differents kinds of tasks (scripts) for management and generation of files, storing them into related repos.
As it started to give interesting results, I decided to put everything into a dedicated organization, so my collaborators can also use them.
But a strange problem then occured : performing a “cross checkout” (checking out files from another repo living in the same organization) gave me a token error, while the same code was working flawlessly in my personal repo.
Of course, I am the owner of this organization and the repos are all public.
After some trials and errors, I have found some kind of workaround : I have created a second personal access token with the same permissions as my GITEA_TOKEN, say ROBOT_uid_TOKEN.
Then I have added a secret at repo level, using the same name and content.
Its name references a username, so I can get something like that
- name: Checkout existing Docker related files
uses: actions/checkout@v4
with:
ref: main
repository: dsin.infra/cas_server_static
path: ./cas_server_docker_tmp
token: ${{ secrets[format('ROBOT_{0}_DEFAULT', env.GITHUB_ACTOR)] }}
It’s working but I think it’s a bit ugly.
Isn’t there a way do access current user’s GITEA_TOKEN at organization level ? I have not been able to find any configuration directive or options related to that.
And if there is no better way to do this, let’s go to next level : I would like to run scheduled tasks, just like a good old Unix cron.
But I have the feeling there is no way to specify a user, so the system account should have it’s own token.
How to create one, as this user is not manageable ?
Thanks for any kind of help
Regards