mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #977] Issue: Git commands on private repos cause act to hang up #572
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#572
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 @ajrice6713 on GitHub (Feb 3, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/977
System information
act: ghcr.io/catthehacker/ubuntuactversion: act version 0.2.25Expected behaviour
Should be able to clone/push to private repositories in act
Actual behaviour
Act simply stops dead in its tracks on
git cloneor git push`Workflow and/or repository
Workflow Example
Steps to reproduce
Call git clone or git pull on a private repository
actoutputThe run just pauses here and never continues to the next step
I believe it is getting hung up on needing git credentials
I am setting GITHUB_TOKEN in a .env file
@ajrice6713 commented on GitHub (Feb 3, 2022):
Running inside of Github Actions i get
fatal: could not read Username for 'https://github.com/': No such device or addressAssuming that this is what act is encountering and just not surfacing to the user
I believe my syntax is also incorrect in that i should be using `git clone git@github.com:{username}/{repo}
but i still believe that this error not being surfaced to the user is a bug
@sosedoff commented on GitHub (Feb 13, 2022):
Indeed, when your action (or code) tries to clone from a HTTPS endpoint,
actwill hang waiting for the password prompt. You can setGIT_TERMINAL_PROMPT=0in the top-levelenvin your workflow. The error you'll see will be slightly different.I think this env var should be set (in act) by default since github actions are non-interactive anyway.
@github-actions[bot] commented on GitHub (Mar 16, 2022):
Issue is stale and will be closed in 14 days unless there is new activity
@BenjaminYdeVintecc commented on GitHub (Mar 2, 2023):
Same issue here.
It hangs when i want to do
gh repo clone <my-repo>Even have the issue when using gh auth login (with token) before the clone.
A workaround could be using the following line
git clone https://<username>:<PAT>@github.com/<owner>/<repo>.git@drew-viles commented on GitHub (Mar 3, 2023):
For anyone still struggling with using private repos, I was building a docker image and scanning with Grype. The building of the docker image required pulling the Dockerfile from the private repo.
When running this with no env vars I'd get:
fatal: could not read Username for 'https://github.com': terminal prompts disabledMy solution to this was to run:
This allowed the job to succeed.
Hope this helps.
@f0lie commented on GitHub (Jan 16, 2025):
I am encounter a similar problem but this time the repo isn't private. Again I am stalling at
git push origin..I have tried to use
GIT_TERMINAL_PROMPT=0but that work around didn't work.