mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #2641] Invocation of gh client results in "command not found" #1198
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @socketbox on GitHub (Jan 30, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2641
Discussed in https://github.com/nektos/act/discussions/2639
Originally posted by socketbox January 29, 2025
In a job that uses the
ubuntu-latestrunner, I've got a step that calls the GitHub API with theghclient, like so:However, the step fails when I run the workflow with the following command (I'm using the GitHub-extension-installed version of act):
gh act schedule -v -s GITHUB_TOKEN=github_pat_foo -W ./.github/workflows/npm-audit.ymlThe full job looks like this:
Here's the error I receive with verbose output:
What's got me puzzled (among other things) is that the catthehacker runner images seem to contain
gh: https://github.com/catthehacker/docker_images/blob/master/linux/ubuntu/scripts/gh.shUpdate: thinking it was possible that I was using a non-standard image for the runner, I logged in to GHCR and then ran
actwith the-Pflag:gh act schedule -P ubuntu-latest="ghcr.io/catthehacker/ubuntu:act-22.04" -v -s GITHUB_TOKEN=github_foo -W ./.github/workflows/npm-audit.ymlStill the same result. I also tried the20.04image, thinking that it might have been removed in the22.04image. No luck.Then I shelled into the pulled image and tried to find
gh. Nothing:Versions:
@ChristopherHX commented on GitHub (Jan 31, 2025):
tags that would contain gh, your selected image does not ship gh
If you really want avoid program not found download the full image, it's almost a 1 : 1 snapshot of the GitHub Hosted Runners, but this one is big use
-vof act to not assume act stalled.@socketbox commented on GitHub (Jan 31, 2025):
@ChristopherHX Thanks for your response.
It seems that I was mistaken regarding this script: https://github.com/catthehacker/docker_images/blob/master/linux/ubuntu/scripts/gh.sh . I thought it was executed as part of all ubuntu-based image builds:
github.com/catthehacker/docker_images@844d48050c/linux/ubuntu/Dockerfile (L25)@ToppDev commented on GitHub (Jan 31, 2025):
Another solution to this is, to add a step installing the GitHub CLI
@robtaylor commented on GitHub (May 14, 2025):
I only found this out from this bug, maybe a doc update would help for the possible images to use?
@matheusmazzoni commented on GitHub (Aug 10, 2025):
I went through the same issue and it would be interesting to mention in the doc that the default image does not have the gh cli
@ChristopherHX commented on GitHub (Aug 10, 2025):
If you want to document this, you can contribute to https://github.com/nektos/act-docs then everybody using act might benefit.
It's just markdown Formatting, very similar to the GitHub Comments / Readme files.