C
C#

help

✅ Can't use `gh webhooks forward`: "Error: you must be authenticated to run this command"

KKiel4/12/2023
I'm trying to forward github webhooks to a local server for testing purposes, following https://docs.github.com/en/webhooks-and-events/webhooks/receiving-webhooks-with-the-github-cli. I've logged in via gh auth login, and requested proper scopes:
> gh auth status
+github.com
+ ✓ Logged in to github.com as XXXXXXXXXXXX (keyring)
+ ✓ Git operations for github.com configured to use https protocol.
+ ✓ Token: gho_************************************
+ ✓ Token scopes: admin:org_hook, gist, read:org, repo, workflow
> gh auth status
+github.com
+ ✓ Logged in to github.com as XXXXXXXXXXXX (keyring)
+ ✓ Git operations for github.com configured to use https protocol.
+ ✓ Token: gho_************************************
+ ✓ Token scopes: admin:org_hook, gist, read:org, repo, workflow
but when I try to run the command to forward webhooks:
> gh webhook forward --org=FooOrg --events=issues --url="https://localhost:44322/api/github/webhooks"
-Error: you must be authenticated to run this command
> gh webhook forward --org=FooOrg --events=issues --url="https://localhost:44322/api/github/webhooks"
-Error: you must be authenticated to run this command
What gives? Wasn't sure where I could possibly ask since there isn't exactly a github CLI discord server I'm aware of, and this place is full of developers... (And yes, I've verified the account I logged in as has proper permissions for the organization. I created the org with that account)
KKiel4/12/2023
oh, I think it's because I'm trying to use a GH App's webhook. clueless
KKiel4/12/2023
Actually, scratch that, that's not the issue - it would simply not push to the webhook at all in this case, not fail to authenticate.
NNergy1014/12/2023
is there a verbose version so you can see where it's trying to Reach?
KKiel4/12/2023
closest I could find is a mention that one can set GH_DEBUG=1. Didn't change anything.
KKiel4/12/2023
GitHub
gh-webhook/forward.go at main · cli/gh-webhook
Contribute to cli/gh-webhook development by creating an account on GitHub.
KKiel4/12/2023
But it's not really making sense or helpful to me, but I'll dig some more to see what it's looking for and why this "token" is empty despite being authenticated
NNergy1014/12/2023
Tried to logout and back in? 😂
KKiel4/12/2023
yep. I followed the rabbit hole to see where it's trying to get the token from and ended up here: https://github.com/cli/go-gh/blob/trunk/pkg/auth/auth.go#L35
GitHub
go-gh/auth.go at trunk · cli/go-gh
A Go module for interacting with gh and the GitHub API from the command line. - go-gh/auth.go at trunk · cli/go-gh
KKiel4/12/2023
It tries to get a token from $GITHUB_TOKEN, then tries to get a token from the gh auth token command by looking up where gh.exe is via $GH_PATH set both of those envvars, even restarted the terminal since I know that's required after mucking around with envvars still fookin' nothing. oh well, I filed an issue. I'm not sure if it's a bug with gh-webhooks or gh-cli itself
NNergy1014/12/2023
Gj on finding all that out tho.
KKiel4/12/2023
update: I was able to actually make it work by setting $GITHUB_TOKEN in my environment variables page. A temporary set GITHUB_TOKEN=xxx didn't work for some reason, I'm guessing that's invalid syntax for powershell, though I didn't get any errors

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
❔ need some help for school assignment - changing image via variablehey, having problems building a microsoft form in c#, part of my assignment is to build a basic educ❔ Writing to StreamWriter FailsHi, I was experimenting with permanently saving things for the first time and ran into problems. Des❔ road mapi have a question, basic c# and .which topic should I study after netcore 5 training?✅ Testing GitHub webhooks on my local machineI'm currently developing a project using <https://github.com/octokit/webhooks.net>. What's the best ❔ How to prevent code from being leaked?When you created a tool and added a licence system like auth.gg, how can you make the code unreadabl❔ Http postHello guys My issue is when I click submit I get This page isn’t working right now If the problem co✅ How to get the form style of a processI need to get the form style of a process❔ Can i develop a discord music bot or admin bot using C#?If i can, how? Any idea?❔ Console inputHi, is it possible to enable console input in web sdk using Host? ```csharp public static as❔ MediaPlayer in WPF occasionally fails```cs public static void PlaySound(string path) { Task.Run(() => ❔ How to Create a C# Code Base for a PC CleanerDoes anyone know of C# to make a base code that for now just clean the %temp% folder just for me to ✅ How to install a callback for an awaited item when using Task.WhenAllHello I am using Task.WhenAll on a List of Tasks. However if a task fails I want to immediately call❔ How to get azure cache for Redis connection string stored in app service as a appsetting variableI have created a azure redis for cache and stored the connection string as application setting varia❔ Giveaway for an online DOTNET ConferenceHello developer students, I am going to give away free tickets to an online dotnet conference whic❔ SoundBoardHi! I am working on a soundboard lately and i got stuck with playing a sound throught microphone. i'❔ accessing object from a class inside of another classI got this class called "Engine"(image 1) that has the object "isOn" which indicates whether the eng❔ QuestionControllerHello, i have a question regarding API structure. I have two classses, Item and Store. I created C❔ Problem Binding to Image SizeI am making an app that displays a series of books. An image and title of the book is to be displaye❔ whats the best site or youtube channel to start learning c#?just downloaded visual studio and wanted to know what would be the best way to learn C#❔ C# MVC - Erroring in VSC not VS2022I'm writing a C# .Net Core 7.0 web application with dapper for my SQL queries. It runs just fine in