backport 7.0.1-beta.1 → 7.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backportRun.d.ts +1 -0
- package/dist/backportRun.js +3 -2
- package/dist/entrypoint.cli.e2e.private.test.js +74 -7
- package/dist/entrypoint.cli.js +12 -1
- package/dist/options/cliArgs.d.ts +1 -1
- package/dist/options/config/readConfigFile.d.ts +1 -1
- package/dist/options/options.d.ts +1 -5
- package/dist/options/options.test.js +26 -28
- package/dist/runSequentially.js +1 -0
- package/dist/runSequentially.test.js +3 -2
- package/dist/services/HandledError.js +3 -1
- package/dist/services/git.d.ts +2 -0
- package/dist/services/git.integration.test.js +66 -13
- package/dist/services/git.js +47 -10
- package/dist/services/git.test.js +15 -1
- package/dist/services/github/v3/addAssigneesToPullRequest.d.ts +1 -1
- package/dist/services/github/v3/addAssigneesToPullRequest.js +3 -6
- package/dist/services/github/v3/addLabelsToPullRequest.d.ts +1 -1
- package/dist/services/github/v3/addLabelsToPullRequest.js +3 -6
- package/dist/services/github/v3/addReviewersToPullRequest.d.ts +1 -1
- package/dist/services/github/v3/addReviewersToPullRequest.js +3 -6
- package/dist/services/github/v3/createPullRequest.js +2 -5
- package/dist/services/github/v4/FetchPullRequestId.js +5 -1
- package/dist/services/github/v4/apiRequestV4.d.ts +6 -2
- package/dist/services/github/v4/apiRequestV4.js +8 -8
- package/dist/services/github/v4/apiRequestV4.test.js +38 -11
- package/dist/services/github/v4/disablePullRequestAutoMerge.js +5 -1
- package/dist/services/github/v4/enablePullRequestAutoMerge.js +4 -3
- package/dist/services/github/v4/fetchAuthorId.js +5 -1
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +0 -3
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.js +23 -12
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +3 -12
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +23 -12
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +3 -11
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +19 -9
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +7 -12
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +0 -1
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.js +19 -8
- package/dist/services/github/v4/fetchExistingPullRequest.js +5 -1
- package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.js +5 -1
- package/dist/services/github/v4/fetchRemoteProjectConfig.d.ts +1 -1
- package/dist/services/github/v4/fetchRemoteProjectConfig.js +13 -20
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +0 -4
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +12 -66
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +0 -19
- package/dist/services/github/v4/getOptionsFromGithub/query.d.ts +3 -16
- package/dist/services/github/v4/getOptionsFromGithub/query.js +9 -19
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.js +5 -1
- package/dist/services/github/v4/mocks/commitsByAuthorMock.js +5 -0
- package/dist/services/logger.d.ts +5 -5
- package/dist/services/logger.js +24 -23
- package/dist/services/remoteConfig.d.ts +20 -0
- package/dist/services/remoteConfig.js +52 -0
- package/dist/services/sourceCommit/getMockSourceCommit.d.ts +4 -0
- package/dist/services/sourceCommit/getMockSourceCommit.js +20 -6
- package/dist/services/sourceCommit/parseSourceCommit.d.ts +3 -4
- package/dist/services/sourceCommit/parseSourceCommit.js +73 -71
- package/dist/services/sourceCommit/parseSourceCommit.test.js +7 -17
- package/dist/test/nockHelpers.js +6 -2
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +4 -4
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +4 -0
- package/dist/ui/getCommits.js +2 -2
- package/dist/ui/ora.d.ts +9 -0
- package/dist/ui/ora.js +21 -0
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +3 -3
- package/dist/services/github/v3/index.d.ts +0 -1
- package/dist/services/github/v3/index.js +0 -61
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
const core = __importStar(require("@actions/core"));
|
|
23
|
-
const exec_1 = require("@actions/exec");
|
|
24
|
-
const github_1 = require("@actions/github");
|
|
25
|
-
const backport_1 = require("backport");
|
|
26
|
-
async function init() {
|
|
27
|
-
const { payload, repo } = github_1.context;
|
|
28
|
-
if (!payload.pull_request) {
|
|
29
|
-
throw Error('Only pull_request events are supported.');
|
|
30
|
-
}
|
|
31
|
-
const pullRequest = payload.pull_request;
|
|
32
|
-
const prAuthor = pullRequest.user.login;
|
|
33
|
-
const accessToken = core.getInput('github_token', { required: true });
|
|
34
|
-
const commitUser = core.getInput('commit_user', { required: false });
|
|
35
|
-
const commitEmail = core.getInput('commit_email', { required: false });
|
|
36
|
-
const autoMerge = core.getInput('auto_merge', { required: false }) === 'true';
|
|
37
|
-
const autoMergeMethod = core.getInput('auto_merge_method', {
|
|
38
|
-
required: false,
|
|
39
|
-
});
|
|
40
|
-
const targetPRLabels = core
|
|
41
|
-
.getInput('target_pr_labels', { required: false })
|
|
42
|
-
.split(',')
|
|
43
|
-
.map((label) => label.trim());
|
|
44
|
-
await (0, exec_1.exec)(`git config --global user.name "${commitUser}"`);
|
|
45
|
-
await (0, exec_1.exec)(`git config --global user.email "${commitEmail}"`);
|
|
46
|
-
await (0, backport_1.backportRun)({
|
|
47
|
-
repoOwner: repo.owner,
|
|
48
|
-
repoName: repo.repo,
|
|
49
|
-
accessToken,
|
|
50
|
-
ci: true,
|
|
51
|
-
pullNumber: pullRequest.number,
|
|
52
|
-
targetPRLabels: targetPRLabels,
|
|
53
|
-
assignees: [prAuthor],
|
|
54
|
-
autoMerge: autoMerge,
|
|
55
|
-
autoMergeMethod: autoMergeMethod,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
init().catch((error) => {
|
|
59
|
-
console.error('An error occurred', error);
|
|
60
|
-
core.setFailed(error.message);
|
|
61
|
-
});
|