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

**URL:** <https://discourse.julialang.org/t/using-github-jl-with-github-actions-errors-due-to-auth-failure/91746>\
**Category:** General Usage\
**Created:** [December 16, 2022, 3:35pm UTC](https://discourse.julialang.org/t/using-github-jl-with-github-actions-errors-due-to-auth-failure/91746 "2022-12-16T15:35:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![logankilpatrick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/logankilpatrick/32/38123_2.png) [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Post date:** [December 16, 2022, 3:35pm UTC](https://discourse.julialang.org/t/using-github-jl-with-github-actions-errors-due-to-auth-failure/91746/1 "2022-12-16T15:35:17Z")

</div>

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](https://github.com/JuliaCommunity/invite/actions/runs/3714150175/jobs/6297675672#step:6:35)

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.

---

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [December 17, 2022, 10:37am UTC](https://discourse.julialang.org/t/using-github-jl-with-github-actions-errors-due-to-auth-failure/91746/2 "2022-12-17T10:37:53Z")

</div>

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…?😅

---

<div class="post-metadata">

**Author:** ![logankilpatrick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/logankilpatrick/32/38123_2.png) [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Post date:** [December 18, 2022, 4:43pm UTC](https://discourse.julialang.org/t/using-github-jl-with-github-actions-errors-due-to-auth-failure/91746/3 "2022-12-18T16:43:29Z")

</div>

I have not tried that since this same workflow is proven successful here: [StackOverflowBot/TwitterBot.jl at main · JuliaLangSlack/StackOverflowBot · GitHub](https://github.com/JuliaLangSlack/StackOverflowBot/blob/main/src/TwitterBot.jl) 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.

---

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [December 19, 2022, 7:20am UTC](https://discourse.julialang.org/t/using-github-jl-with-github-actions-errors-due-to-auth-failure/91746/4 "2022-12-19T07:20:00Z")

</div>

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](https://github.com/skleinbo/invite/actions/runs/3719482290/jobs/6308364864)  
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.
