From 14ac173bcffd0a72b08b5c47ca0799029f862682 Mon Sep 17 00:00:00 2001 From: eric sciple Date: Mon, 1 Dec 2025 19:53:23 -0600 Subject: Add worktree support for persist-credentials includeIf (#2327) --- dist/index.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dist') diff --git a/dist/index.js b/dist/index.js index a251a19..b9b34d3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -412,6 +412,9 @@ class GitAuthHelper { // Configure host includeIf const hostIncludeKey = `includeIf.gitdir:${gitDir}.path`; yield this.git.config(hostIncludeKey, credentialsConfigPath); + // Configure host includeIf for worktrees + const hostWorktreeIncludeKey = `includeIf.gitdir:${gitDir}/worktrees/*.path`; + yield this.git.config(hostWorktreeIncludeKey, credentialsConfigPath); // Container git directory const workingDirectory = this.git.getWorkingDirectory(); const githubWorkspace = process.env['GITHUB_WORKSPACE']; @@ -424,6 +427,9 @@ class GitAuthHelper { // Configure container includeIf const containerIncludeKey = `includeIf.gitdir:${containerGitDir}.path`; yield this.git.config(containerIncludeKey, containerCredentialsPath); + // Configure container includeIf for worktrees + const containerWorktreeIncludeKey = `includeIf.gitdir:${containerGitDir}/worktrees/*.path`; + yield this.git.config(containerWorktreeIncludeKey, containerCredentialsPath); } }); } -- cgit v1.2.3