Using GitHub.jl with GitHub Actions errors due to auth failure

Hey folks, I am trying to get a repo setup to automate sending invites to an org through GitHub.jl, everything works fine locally, but when I move it to a GitHub action, all of a sudden GitHub.jl cannot authenticate despite me passing in my Personal Access Token as an argument.

Here’s the GitHub action logs: Fix typo in README · JuliaCommunity/invite@daa6d64 · GitHub

I tried the same code that I have in the invite.yml action definition and just hardcoded the access token to no avail. I also made sure the token has the right auth permissions.

Have you tried having the script use the environment variabels that are defined in the workflow instead of passing them as command line arguments? Maybe there’s something unforeseen happening with escaping or whatnot.

I suppose you checked that the repo secret isn’t wrapped in quotation marks…?:sweat_smile:

I have not tried that since this same workflow is proven successful here: StackOverflowBot/TwitterBot.jl at main · JuliaLangSlack/StackOverflowBot · GitHub which mirrors a similar setup I have had going for 3 years now. It is just the GitHub access token that seems to be unhappy.

I was asking, because it worked well for me. I cloned your repo, stripped all the Airtables stuff, and created a repo secret with a PAT. Authentication works and returns a valid OAuth2 token: no airtables · skleinbo/invite@020104f · GitHub
Note that the only argument passed to Julia is AUTH_TOKEN.

That made me think the token passed on the command line is somehow not identical to the one stored as secrets.AUTH_TOKEN.

Even if the token had insufficient permissions for the actual work, authentication at the very least should happen.