You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const parts = url.pathname.replace(/^\//, '').replace(/\.git$/, '').split('/');
105
+
remoteOwner = parts[0];
106
+
remoteRepo = parts[1];
107
+
} catch {
108
+
// SSH: git@github.com:owner/repo.git
109
+
const match = remoteUrl.match(/[^:]+:([^/]+)\/(.+?)(?:\.git)?$/);
110
+
if (match) {
111
+
remoteOwner = match[1];
112
+
remoteRepo = match[2];
113
+
}
114
+
}
115
+
if (!remoteOwner || !remoteRepo) {
116
+
core.setFailed(`Could not parse git remote URL to validate repository: ${remoteUrl}`);
117
+
return;
118
+
}
119
+
if (remoteOwner.toLowerCase() !== owner.toLowerCase() || remoteRepo.toLowerCase() !== repo.toLowerCase()) {
120
+
core.setFailed(`Auto-detect requires the local git remote to match the target repository. Remote is ${remoteOwner}/${remoteRepo} but targeting ${owner}/${repo}. Use explicit \`files\` input when targeting a different repository.`);
121
+
return;
122
+
}
123
+
80
124
// Combine working tree and staged changes so that staged-only changes are included
0 commit comments