mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
[CI] test built
This commit is contained in:
parent
d7db273d6c
commit
ef5431787d
2 changed files with 10 additions and 6 deletions
15
dist/index.js
vendored
15
dist/index.js
vendored
|
@ -339,7 +339,7 @@ function createPullRequest(inputs) {
|
||||||
throw new Error(`Repository '${branchRepository}' is not a fork of '${baseRemote.repository}'. Unable to continue.`);
|
throw new Error(`Repository '${branchRepository}' is not a fork of '${baseRemote.repository}'. Unable to continue.`);
|
||||||
}
|
}
|
||||||
// Add a remote for the fork
|
// Add a remote for the fork
|
||||||
const remoteUrl = utils.getRemoteUrl(baseRemote.protocol, branchRepository);
|
const remoteUrl = utils.getRemoteUrl(baseRemote.protocol, baseRemote.hostname, branchRepository);
|
||||||
yield git.exec(['remote', 'add', 'fork', remoteUrl]);
|
yield git.exec(['remote', 'add', 'fork', remoteUrl]);
|
||||||
}
|
}
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
|
@ -1247,11 +1247,13 @@ function getRemoteDetail(remoteUrl) {
|
||||||
if (!githubServerMatch) {
|
if (!githubServerMatch) {
|
||||||
throw new Error('Could not parse GitHub Server name');
|
throw new Error('Could not parse GitHub Server name');
|
||||||
}
|
}
|
||||||
const httpsUrlPattern = new RegExp('^https?://.*@?' + githubServerMatch[1] + '/(.+/.+?)(\\.git)?$', 'i');
|
const hostname = githubServerMatch[1];
|
||||||
const sshUrlPattern = new RegExp('^git@' + githubServerMatch[1] + ':(.+/.+)\\.git$', 'i');
|
const httpsUrlPattern = new RegExp('^https?://.*@?' + hostname + '/(.+/.+?)(\\.git)?$', 'i');
|
||||||
|
const sshUrlPattern = new RegExp('^git@' + hostname + ':(.+/.+)\\.git$', 'i');
|
||||||
const httpsMatch = remoteUrl.match(httpsUrlPattern);
|
const httpsMatch = remoteUrl.match(httpsUrlPattern);
|
||||||
if (httpsMatch) {
|
if (httpsMatch) {
|
||||||
return {
|
return {
|
||||||
|
hostname,
|
||||||
protocol: 'HTTPS',
|
protocol: 'HTTPS',
|
||||||
repository: httpsMatch[1]
|
repository: httpsMatch[1]
|
||||||
};
|
};
|
||||||
|
@ -1259,6 +1261,7 @@ function getRemoteDetail(remoteUrl) {
|
||||||
const sshMatch = remoteUrl.match(sshUrlPattern);
|
const sshMatch = remoteUrl.match(sshUrlPattern);
|
||||||
if (sshMatch) {
|
if (sshMatch) {
|
||||||
return {
|
return {
|
||||||
|
hostname,
|
||||||
protocol: 'SSH',
|
protocol: 'SSH',
|
||||||
repository: sshMatch[1]
|
repository: sshMatch[1]
|
||||||
};
|
};
|
||||||
|
@ -1266,10 +1269,10 @@ function getRemoteDetail(remoteUrl) {
|
||||||
throw new Error(`The format of '${remoteUrl}' is not a valid GitHub repository URL`);
|
throw new Error(`The format of '${remoteUrl}' is not a valid GitHub repository URL`);
|
||||||
}
|
}
|
||||||
exports.getRemoteDetail = getRemoteDetail;
|
exports.getRemoteDetail = getRemoteDetail;
|
||||||
function getRemoteUrl(protocol, repository) {
|
function getRemoteUrl(protocol, hostname, repository) {
|
||||||
return protocol == 'HTTPS'
|
return protocol == 'HTTPS'
|
||||||
? `https://github.com/${repository}`
|
? `https://${hostname}/${repository}`
|
||||||
: `git@github.com:${repository}.git`;
|
: `git@${hostname}:${repository}.git`;
|
||||||
}
|
}
|
||||||
exports.getRemoteUrl = getRemoteUrl;
|
exports.getRemoteUrl = getRemoteUrl;
|
||||||
function secondsSinceEpoch() {
|
function secondsSinceEpoch() {
|
||||||
|
|
1
report.txt
Normal file
1
report.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1669083873
|
Loading…
Add table
Add a link
Reference in a new issue