-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
'actions/checkout@v4' with LFS fails because of double auth header #1830
Comments
For anyone interested here's a workaround to get this to work: - uses: actions/checkout@v4
with:
persist-credentials: 'true' # Optional; should be the default
- name: Checkout lfs
run: |
git lfs install --local
AUTH=$(git config --local http.${{ github.server_url }}/.extraheader)
git config --local --unset http.${{ github.server_url }}/.extraheader
git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
git lfs pull |
Can you share a workflow reproducing this issue? |
|
As a former Git LFS maintainer and a Git contributor, the proper solution here is to use a credential helper. The Git FAQ outlines how to do this with a small shell script. Using If you use a credential helper, then Git LFS will only call it when it doesn't have other credentials, and so it won't add a second If you need Bearer or other types of authentication, Git 2.46 supports extensions to the credential helper protocol to handle that case, and I added it specifically to get people to stop using Similarly, if you need to send the credentials on the first go and not wait for a 401 like Git normally does, then Git 2.47 has I know there was some discussion elsewhere of broken versions of Apple Git that performed inappropriate caching, but I am happy as a Git contributor to simply say that changes that don't honour the original protocol are bugs. If you can provide an example of that problem to the Git list (and CC the personal email I have in the Git |
How does one enable the credential helper in the github action? |
@bk2204 What is the recommended workflow to use these credential helpers? |
This is the only thing that worked for me. Credential Helpers did nothing, double Auth Headers were still there. |
@leonbohmann Thanks for the workaround. Do you know what is the equivalent of |
For me, I use these commands directly instead of
|
Not my workaround, just quoted an answer from above: #1830 (comment) The github.server_url can remain unchanged. The gitea act runner picks it up just fine. I literally copy pasted the code into a workflow step. Just add a $ in front of auth, to make it correct Powershell. |
I am encountering an issue with the Git LFS integration in my Workflow. The problem involves the sending of double Authorization headers in HTTP requests, which results in a 400 Bad Request error. This issue is preventing successful data transfers and impacting the workflow execution. The problem mainly occurs in my submodules, since these require Git LFS.
The first LFS batch request works without problem and I see only one basic authorization.
Error Log
Here is a snippet from the workflow logs that illustrates the issue:
Steps to Reproduce
Expected Behavior
The HTTP requests made by Git LFS should include only a single Authorization header.
Actual Behavior
The HTTP requests include two Authorization headers, leading to a 400 Bad Request error.
More information about this issue:
https://gitea.com/gitea/act_runner/issues/164#issue-194072
https://gitea.com/gitea/act_runner/issues/164#issuecomment-739866
https://gitea.com/gitea/act_runner/issues/164#issuecomment-836693
The text was updated successfully, but these errors were encountered: