What's wrong with tokens in github actions ? #145138
Unanswered
MatthieuGomes
asked this question in
Actions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
It's been a week now since I started to work with github actions and I'm still strugling a lot with it... But particularly with token access.
Context
I'm trying to make some project management automations on a project, linked to a repo (or more later) which seem basic to me, but not implemented in github yet (moving a card to a certain collumn when a commit mentionning a certain issue is pushed, move to another collumn when a pull request is open, adding labels automatically, etc.).
To do so, I use
In this context, I need to use a token to access the graphql api.
Current situation
PAT settings in organization
General policies of Actions
Workflow permission of GITHUB_TOKEN
PAT settings on my side
My permissions in workflow
Problems
1. GraphQL
When I use my PAT token, both in postman and github action, to make queries involving nodes (ex: projectV2), everything works fine ! BUT when I try to do the same thing with the GITHUB_TOKEN, nodes is now and empty list and I can't access to the data I need. No errors, nothing, just an empty list.
here is the query I use :
there is the response to my request via postman
and here is the response to the same request via github action when using GITHUB_TOKEN
WHY ?! In the end, I could have just used my PAT token, but I want to understand why it doesn't work with GITHUB_TOKEN... And there is a second problem.
2. Git push.
For... Reasons, I need to push some files to the repo. Tired of pushing for testing, I decided to use act to test my workflow locally... and when I tried, everything worked fine !
But when I tried it with github action... I got the following error :
no matter the token I try to use : PAT or GITHUB_TOKEN... SAME RESULT. AND I HAVE ALL PERMISSIONS WITH BOTH.
by the way, I can't make pushes with an "anonymous" user, I need to use my own account. (so far)
Conclusion
I need help. I don't understand why it doesn't work, I don't know what to do anymore... I'm stuck. I'm tired. I'm lost. I'm desperate. I'm sad. I'm angry. I'm hungry. I'm thirsty. I'm sleepy.
PLEASE !
Beta Was this translation helpful? Give feedback.
All reactions