Skip to content

Checkout task with persistCredentials doesn't set credentials for submodule repo(s) when needed #4114

@sphanley

Description

@sphanley

Agent Version and Platform

2.213.2 on MacOS

Azure DevOps Type and Version

dev.azure.com, organization name can be provided if needed.

What's not working?

I'm using the Azure Pipelines checkout task with submodules: true and fetchDepth: 1. Later in my pipeline, in some cases I need to fetch additional depth, so I've set persistCredentials: true. This causes the following line to be added to the end of my checkout (I've obscured organizational info using curly-brackets):

git config http.https://{organization}@dev.azure.com/{organization}/{project}/_git/{repo}.extraheader "AUTHORIZATION: placeholder_{...}"

However, since this persisted credential is only set for the main repo, and not my submodule repo, I'm getting the following error later when I try to fetch additional depth, with submodules recursed:

Fetching submodule {submodule repository name}
fatal: could not read Password for 'https://{organization}@dev.azure.com': terminal prompts disabled

The desired behavior for this use case would be that if persistCredentials is set to true on a checkout where submodules is also true, the credentials would be persisted for both the top-level repo and also any submodule repositories.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions