0

I am trying to run below command in Jenkins pipeline

$ gh pr create --title "The bug is fixed" --body "Everything works again"
$ gh pr create --reviewer monalisa,hubot  --reviewer myorg/team-name
$ gh pr create --project "Roadmap"
$ gh pr create --base develop --head monalisa:feature

Getting error gh: command not found where general git command are working fine like git checkout -f fedb73c252b8f058a83ab222648c08265f442876 is there any way to fix this issue ?

torek
  • 448,244
  • 59
  • 642
  • 775
Avinash Dalvi
  • 8,551
  • 7
  • 27
  • 53

1 Answers1

4

git is part of every linux install and as such is available in /usr/bin/git via most default PATH. gh is Github CLI and may not have been installed on the node running your pipeline. Or, if installed, as the jenkins agent process launches via non-interactive shell, is not likely to be available in the default PATH.

You'd have to check your installation/configuration to determine the next steps. A quick fix if installed is prepend the /full/path/to/gh (Not a gh user, so won't provide guidance beyond the above).

Ian W
  • 4,559
  • 2
  • 18
  • 37