Jenkins github cli

Hi Team,

I need to run the github cli queries using jenkins , but i am facing issues in authenticating github cli via jenkins ,

Can someone guide me the process to authenticate github cli via jenkins and run the github cli commands ??

The documentation states the default authentication mode is a web-based browser flow.
Alternatively, pass in a token on standard input by using --with-token . The minimum required scopes for the token are: “repo”, “read:org”

Hi Byrneh,

Thanks for the details , Actually I am facing a ceritifcate issue now , When i am running
gh auth login --hostname in my Ec2 instance which has an ssl certificate installed , I am getting an error saying

could not validate token : get " : x 509 certificate signed by unknown authority

Any help in the below error would be appreciated

@vinodkumar4b9 Something like this is normally self signed certificate type issue. Which is where the trust store of the client (github cli) in your example ) does not trust the root CA of your site certificate, or something else wrong or weird with your certificate/certficate chain

Hi Byrneh,

Thanks for your details, May I know how to fix the issue for example if Github cli doesn’t trust the root CA of your site certificate , It would be very helpful if you can help me in fixing the issue as I need to run some github cli commands on my Ec2

HI Byrneh,

Any update on the below issue and how Can I fix it , your help will always be appreciated.

I had a quick read through the docs and didn’t see any options to specify alternate trust stores/certs that other tools do like git, curl etc.
It seems to be written in go (golang) and another issue post I found suggested adding to system trust store

I can only suggest looking at how you would resolve by referring to golang docs

For Windows:
For Linux: