Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication failed with proxy #1897

Open
Laxy317 opened this issue Sep 18, 2024 · 1 comment
Open

Authentication failed with proxy #1897

Laxy317 opened this issue Sep 18, 2024 · 1 comment

Comments

@Laxy317
Copy link

Laxy317 commented Sep 18, 2024

I set up the proxy "https://ghp.ci/" to my runner machine, but I got an error:

Error: fatal: Authentication failed for 'https://ghp.ci/https://github.com/xxx/xxx/'

The code in workflow is:

    steps:
      - name: Checkout
        uses: actions/checkout@v4

After that, I tried to authenticate the identity using a custom PAT, I added the secret and changed the code to:

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.PAT }}

I still get the same error.
But if I try to run command locally and enter the PAT as password, it runs successfully:

git clone https://ghp.ci/https://github.com/xxx/xxx/
Username for 'https://ghp.ci':xxx
Password for 'https://xxx@ghp.ci':
remote: Enumerating objects: 317, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 317 (delta 38), reused 46 (delta 27), pack-reused 221 (from 1)
Receiving objects: 100% (317/317), 143.40 KiB | 315.00 KiB/s, done.
Resolving deltas: 100% (144/144), done.
@Laxy317 Laxy317 closed this as completed Sep 19, 2024
@Laxy317 Laxy317 reopened this Sep 19, 2024
@Laxy317
Copy link
Author

Laxy317 commented Sep 19, 2024

I found out that this was due to the PAT I had configured on the runner .gitconfig is out of date.

I think token should be set in checkout, not in .gitconfig, because workflows have different permissions. So I try to clean up the PAT in .gitconfig, after that the config in .gitconfig become url https://ghp.ci/https://github.com/(Before that it is url https://user:my_token@ghp.ci/https://github.com/ ).
But checkout fails by error:

Error: fatal: could not read Username for 'https://ghp.ci/': terminal prompts disabled

Is there any way I can set up a proxy on the runner and use checkout for authentication at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant