[CI] test committed

This commit is contained in:
peter-evans 2021-02-01 01:00:06 +00:00 committed by GitHub
parent 2455e15969
commit 5ee5eddf9b
2 changed files with 24 additions and 10 deletions

33
dist/index.js vendored
View file

@ -391,7 +391,20 @@ function createPullRequest(inputs) {
inputs.base = result.base; inputs.base = result.base;
if (result.hasDiffWithBase) { if (result.hasDiffWithBase) {
// Create or update the pull request // Create or update the pull request
yield githubHelper.createOrUpdatePullRequest(inputs, baseRemote.repository, branchRepository); const pull = yield githubHelper.createOrUpdatePullRequest(inputs, baseRemote.repository, branchRepository);
// Set outputs
core.startGroup('Setting outputs');
core.setOutput('pull-request-number', pull.number);
core.setOutput('pull-request-url', pull.html_url);
if (pull.created) {
core.setOutput('pull-request-operation', 'created');
}
else if (result.action == 'updated') {
core.setOutput('pull-request-operation', 'updated');
}
// Deprecated
core.exportVariable('PULL_REQUEST_NUMBER', pull.number);
core.endGroup();
} }
else { else {
// There is no longer a diff with the base // There is no longer a diff with the base
@ -406,6 +419,10 @@ function createPullRequest(inputs) {
branchRemoteName, branchRemoteName,
`refs/heads/${inputs.branch}` `refs/heads/${inputs.branch}`
]); ]);
// Set outputs
core.startGroup('Setting outputs');
core.setOutput('pull-request-operation', 'closed');
core.endGroup();
} }
} }
} }
@ -919,7 +936,8 @@ class GitHubHelper {
core.info(`Created pull request #${pull.number} (${headBranch} => ${inputs.base})`); core.info(`Created pull request #${pull.number} (${headBranch} => ${inputs.base})`);
return { return {
number: pull.number, number: pull.number,
html_url: pull.html_url html_url: pull.html_url,
created: true
}; };
} }
catch (e) { catch (e) {
@ -937,7 +955,8 @@ class GitHubHelper {
core.info(`Updated pull request #${pull.number} (${headBranch} => ${inputs.base})`); core.info(`Updated pull request #${pull.number} (${headBranch} => ${inputs.base})`);
return { return {
number: pull.number, number: pull.number,
html_url: pull.html_url html_url: pull.html_url,
created: false
}; };
}); });
} }
@ -956,13 +975,6 @@ class GitHubHelper {
const headBranch = `${headOwner}:${inputs.branch}`; const headBranch = `${headOwner}:${inputs.branch}`;
// Create or update the pull request // Create or update the pull request
const pull = yield this.createOrUpdate(inputs, baseRepository, headBranch); const pull = yield this.createOrUpdate(inputs, baseRepository, headBranch);
// Set outputs
core.startGroup('Setting outputs');
core.setOutput('pull-request-number', pull.number);
core.setOutput('pull-request-url', pull.html_url);
// Deprecated
core.exportVariable('PULL_REQUEST_NUMBER', pull.number);
core.endGroup();
// Set milestone, labels and assignees // Set milestone, labels and assignees
const updateIssueParams = {}; const updateIssueParams = {};
if (inputs.milestone) { if (inputs.milestone) {
@ -1003,6 +1015,7 @@ class GitHubHelper {
} }
} }
} }
return pull;
}); });
} }
} }

1
report.txt Normal file
View file

@ -0,0 +1 @@
1612141206