backport 11.0.2 → 12.0.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.
Files changed (123) hide show
  1. package/README.md +7 -8
  2. package/dist/src/entrypoint.api.d.ts +44 -21
  3. package/dist/src/entrypoint.api.js +9 -9
  4. package/dist/src/entrypoint.api.js.map +1 -1
  5. package/dist/src/graphql/generated/gql.d.ts +14 -14
  6. package/dist/src/graphql/generated/gql.js +7 -7
  7. package/dist/src/graphql/generated/gql.js.map +1 -1
  8. package/dist/src/graphql/generated/graphql.d.ts +274 -34600
  9. package/dist/src/graphql/generated/graphql.js +8 -3514
  10. package/dist/src/graphql/generated/graphql.js.map +1 -1
  11. package/dist/src/lib/backport-error.js +1 -1
  12. package/dist/src/lib/backport-error.js.map +1 -1
  13. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.d.ts +1 -1
  14. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.js +4 -4
  15. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/auto-merge-now-or-later.js.map +1 -1
  16. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.d.ts +1 -1
  17. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.js +2 -2
  18. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/copy-source-pull-request-reviewers-to-target-pull-request.js.map +1 -1
  19. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.js +3 -3
  20. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/get-commits-without-backports.js.map +1 -1
  21. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.js +7 -7
  22. package/dist/src/lib/cherrypickAndCreateTargetPullRequest/wait-for-cherrypick.js.map +1 -1
  23. package/dist/src/lib/child-process-promisified.js +2 -0
  24. package/dist/src/lib/child-process-promisified.js.map +1 -1
  25. package/dist/src/lib/env.d.ts +1 -1
  26. package/dist/src/lib/env.js +3 -3
  27. package/dist/src/lib/env.js.map +1 -1
  28. package/dist/src/lib/get-commits.js +5 -5
  29. package/dist/src/lib/get-commits.js.map +1 -1
  30. package/dist/src/lib/git/cherrypick.js +1 -1
  31. package/dist/src/lib/git/remote.d.ts +2 -2
  32. package/dist/src/lib/git/remote.js +4 -4
  33. package/dist/src/lib/git/remote.js.map +1 -1
  34. package/dist/src/lib/github/v3/add-assignees-to-pull-request.d.ts +2 -2
  35. package/dist/src/lib/github/v3/add-assignees-to-pull-request.js +2 -2
  36. package/dist/src/lib/github/v3/add-labels-to-pull-request.d.ts +2 -2
  37. package/dist/src/lib/github/v3/add-labels-to-pull-request.js +2 -2
  38. package/dist/src/lib/github/v3/add-reviewers-to-pull-request.d.ts +2 -2
  39. package/dist/src/lib/github/v3/add-reviewers-to-pull-request.js +2 -2
  40. package/dist/src/lib/github/v3/create-pull-request/create-pull-request.js +3 -3
  41. package/dist/src/lib/github/v3/create-pull-request/create-pull-request.js.map +1 -1
  42. package/dist/src/lib/github/v3/create-pull-request/get-pull-request-body.js +22 -8
  43. package/dist/src/lib/github/v3/create-pull-request/get-pull-request-body.js.map +1 -1
  44. package/dist/src/lib/github/v3/create-status-comment.js +4 -4
  45. package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.d.ts +1 -1
  46. package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.js +4 -4
  47. package/dist/src/lib/github/v3/get-reviewers-from-pull-requests.js.map +1 -1
  48. package/dist/src/lib/github/v3/merge-pull-request.js +2 -2
  49. package/dist/src/lib/github/v3/octokit-client.d.ts +2 -2
  50. package/dist/src/lib/github/v3/octokit-client.js +2 -2
  51. package/dist/src/lib/github/v4/client/graphql-client.d.ts +2 -2
  52. package/dist/src/lib/github/v4/client/graphql-client.js +2 -2
  53. package/dist/src/lib/github/v4/disable-pull-request-auto-merge.js +2 -2
  54. package/dist/src/lib/github/v4/enable-pull-request-auto-merge.js +6 -7
  55. package/dist/src/lib/github/v4/enable-pull-request-auto-merge.js.map +1 -1
  56. package/dist/src/lib/github/v4/fetch-author-id.d.ts +2 -2
  57. package/dist/src/lib/github/v4/fetch-author-id.js +2 -2
  58. package/dist/src/lib/github/v4/fetch-existing-pull-request.d.ts +1 -1
  59. package/dist/src/lib/github/v4/fetch-existing-pull-request.js +2 -2
  60. package/dist/src/lib/github/v4/fetch-pull-request-auto-merge-method.js +5 -5
  61. package/dist/src/lib/github/v4/fetch-pull-request-auto-merge-method.js.map +1 -1
  62. package/dist/src/lib/github/v4/fetch-pull-request-id.js +5 -9
  63. package/dist/src/lib/github/v4/fetch-pull-request-id.js.map +1 -1
  64. package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.d.ts +1 -1
  65. package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.js +9 -6
  66. package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-pull-number.js.map +1 -1
  67. package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.d.ts +1 -1
  68. package/dist/src/lib/github/v4/fetchCommits/fetch-commit-by-sha.js +2 -2
  69. package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.d.ts +4 -4
  70. package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.js +13 -13
  71. package/dist/src/lib/github/v4/fetchCommits/fetch-commits-by-author.js.map +1 -1
  72. package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.d.ts +1 -1
  73. package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.js +8 -6
  74. package/dist/src/lib/github/v4/fetchCommits/fetch-commits-for-rebase-and-merge-strategy.js.map +1 -1
  75. package/dist/src/lib/github/v4/fetchCommits/fetch-pull-requests-by-search-query.d.ts +5 -5
  76. package/dist/src/lib/github/v4/fetchCommits/fetch-pull-requests-by-search-query.js +13 -13
  77. package/dist/src/lib/github/v4/fetchCommits/fetch-pull-requests-by-search-query.js.map +1 -1
  78. package/dist/src/lib/github/v4/{get-invalid-access-token-message.d.ts → get-invalid-github-token-message.d.ts} +2 -1
  79. package/dist/src/lib/github/v4/{get-invalid-access-token-message.js → get-invalid-github-token-message.js} +9 -5
  80. package/dist/src/lib/github/v4/get-invalid-github-token-message.js.map +1 -0
  81. package/dist/src/lib/github/v4/get-repo-owner-and-name-from-git-remotes.d.ts +2 -2
  82. package/dist/src/lib/github/v4/get-repo-owner-and-name-from-git-remotes.js +2 -2
  83. package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.d.ts +40 -17
  84. package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.js +15 -14
  85. package/dist/src/lib/github/v4/getOptionsFromGithub/get-options-from-github.js.map +1 -1
  86. package/dist/src/lib/github/v4/index.d.ts +1 -1
  87. package/dist/src/lib/github/v4/index.js +1 -1
  88. package/dist/src/lib/github/v4/mocks/commits-by-author-mock.js +1 -2
  89. package/dist/src/lib/github/v4/mocks/commits-by-author-mock.js.map +1 -1
  90. package/dist/src/lib/github/v4/validate-target-branch.d.ts +2 -2
  91. package/dist/src/lib/github/v4/validate-target-branch.js +2 -2
  92. package/dist/src/lib/logger.d.ts +5 -5
  93. package/dist/src/lib/logger.js +13 -13
  94. package/dist/src/lib/remote-config.d.ts +90 -1
  95. package/dist/src/lib/run-sequentially.js +1 -1
  96. package/dist/src/lib/run-sequentially.js.map +1 -1
  97. package/dist/src/lib/setup-repo.js +2 -2
  98. package/dist/src/lib/sourceCommit/get-pull-request-states.js +4 -4
  99. package/dist/src/lib/sourceCommit/get-pull-request-states.js.map +1 -1
  100. package/dist/src/lib/sourceCommit/get-source-pull-request.d.ts +21 -191
  101. package/dist/src/lib/sourceCommit/get-source-pull-request.js +5 -1
  102. package/dist/src/lib/sourceCommit/get-source-pull-request.js.map +1 -1
  103. package/dist/src/lib/sourceCommit/parse-source-commit.js +7 -6
  104. package/dist/src/lib/sourceCommit/parse-source-commit.js.map +1 -1
  105. package/dist/src/options/cli-args.d.ts +10 -11
  106. package/dist/src/options/cli-args.js +85 -53
  107. package/dist/src/options/cli-args.js.map +1 -1
  108. package/dist/src/options/config/config.d.ts +184 -66
  109. package/dist/src/options/config/config.js +6 -3
  110. package/dist/src/options/config/config.js.map +1 -1
  111. package/dist/src/options/config/global-config.js +2 -2
  112. package/dist/src/options/config/read-config-file.d.ts +1 -0
  113. package/dist/src/options/config/read-config-file.js +60 -4
  114. package/dist/src/options/config/read-config-file.js.map +1 -1
  115. package/dist/src/options/config-options.d.ts +8 -95
  116. package/dist/src/options/option-schema.d.ts +169 -24
  117. package/dist/src/options/option-schema.js +65 -18
  118. package/dist/src/options/option-schema.js.map +1 -1
  119. package/dist/src/options/options.d.ts +1 -2
  120. package/dist/src/options/options.js +106 -50
  121. package/dist/src/options/options.js.map +1 -1
  122. package/package.json +25 -25
  123. package/dist/src/lib/github/v4/get-invalid-access-token-message.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { isEmpty, difference } from 'lodash-es';
2
2
  import { getGlobalConfigPath } from '../../env.js';
3
3
  import { logger } from '../../logger.js';
4
- export function getInvalidAccessTokenMessage({ result, repoOwner, repoName, globalConfigFile, }) {
4
+ export function getInvalidGithubTokenMessage({ result, repoOwner, repoName, globalConfigFile, githubToken, }) {
5
5
  function getSSOAuthUrl(ssoHeader) {
6
6
  const matches = ssoHeader?.match(/url=(.*)/);
7
7
  if (matches) {
@@ -21,7 +21,7 @@ export function getInvalidAccessTokenMessage({ result, repoOwner, repoName, glob
21
21
  const hasRequiredScopes = isEmpty(difference(requiredScopes.split(',').map((s) => s.trim()), grantedScopes.split(',').map((s) => s.trim())));
22
22
  // user does not have permission to the repo
23
23
  if (!hasRequiredScopes) {
24
- return `You do not have access to the repository "${repoOwner}/${repoName}". Please make sure your access token has the required scopes.\n\nRequired scopes: ${requiredScopes}\nAccess token scopes: ${grantedScopes}`;
24
+ return `You do not have access to the repository "${repoOwner}/${repoName}". Please make sure your GitHub token has the required scopes.\n\nRequired scopes: ${requiredScopes}\nGranted scopes: ${grantedScopes}`;
25
25
  }
26
26
  // repo does not exist
27
27
  return `The repository "${repoOwner}/${repoName}" doesn't exist`;
@@ -30,12 +30,16 @@ export function getInvalidAccessTokenMessage({ result, repoOwner, repoName, glob
30
30
  const ssoAuthUrl = getSSOAuthUrl(ssoHeader);
31
31
  // user does not have permissions
32
32
  if (repoAccessForbidden && ssoAuthUrl) {
33
- return `Please follow the link to authorize your personal access token with SSO:\n\n${ssoAuthUrl}`;
33
+ return `Please follow the link to authorize your GitHub token with SSO:\n\n${ssoAuthUrl}`;
34
34
  }
35
35
  break;
36
36
  }
37
37
  case 401: {
38
- return `Please check your access token and make sure it is valid.\nConfig: ${getGlobalConfigPath(globalConfigFile)}`;
38
+ const globalConfigPath = getGlobalConfigPath(globalConfigFile);
39
+ const redactedToken = githubToken
40
+ ? `${githubToken.slice(0, 4)}...${githubToken.slice(-4)}`
41
+ : 'undefined';
42
+ return `The GitHub token "${redactedToken}" is invalid. Please make sure your global config (${globalConfigPath}) contains a valid token:\n\n{ "githubToken": "<valid_token>" }`;
39
43
  }
40
44
  case undefined: {
41
45
  logger.warn('Missing status code');
@@ -47,4 +51,4 @@ export function getInvalidAccessTokenMessage({ result, repoOwner, repoName, glob
47
51
  }
48
52
  }
49
53
  }
50
- //# sourceMappingURL=get-invalid-access-token-message.js.map
54
+ //# sourceMappingURL=get-invalid-github-token-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-invalid-github-token-message.js","sourceRoot":"","sources":["../../../../../src/lib/github/v4/get-invalid-github-token-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,MAAM,UAAU,4BAA4B,CAAC,EAC3C,MAAM,EACN,SAA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AndNameFromGitRemotes({ accessToken, githubApiBaseUrlV4, cwd, }: {
2
- accessToken: string;
1
+ export declare function getRepoOwnerAndNameFromGitRemotes({ githubToken, githubApiBaseUrlV4, cwd, }: {
2
+ githubToken: string;
3
3
  githubApiBaseUrlV4?: string;
4
4
  cwd: string;
5
5
  }): Promise<{
@@ -4,7 +4,7 @@ import { getRepoInfoFromGitRemotes } from '../../git/index.js';
4
4
  import { logger } from '../../logger.js';
5
5
  import { graphqlRequest } from './client/graphql-client.js';
6
6
  // This method should be used to get the origin owner (instead of a fork owner)
7
- export async function getRepoOwnerAndNameFromGitRemotes({ accessToken, githubApiBaseUrlV4, cwd, }) {
7
+ export async function getRepoOwnerAndNameFromGitRemotes({ githubToken, githubApiBaseUrlV4, cwd, }) {
8
8
  const remotes = await getRepoInfoFromGitRemotes({ cwd });
9
9
  const firstRemote = remotes.at(0);
10
10
  if (!firstRemote) {
@@ -31,7 +31,7 @@ export async function getRepoOwnerAndNameFromGitRemotes({ accessToken, githubApi
31
31
  }
32
32
  }
33
33
  `);
34
- const result = await graphqlRequest({ accessToken, githubApiBaseUrlV4 }, query, variables);
34
+ const result = await graphqlRequest({ githubToken, githubApiBaseUrlV4 }, query, variables);
35
35
  if (result.error) {
36
36
  throw new BackportError({
37
37
  code: 'github-api-exception',
@@ -1,6 +1,6 @@
1
1
  export type OptionsFromGithub = Awaited<ReturnType<typeof getOptionsFromGithub>>;
2
2
  export declare function getOptionsFromGithub(options: {
3
- accessToken: string;
3
+ githubToken: string;
4
4
  cwd?: string;
5
5
  githubApiBaseUrlV4?: string;
6
6
  repoName: string;
@@ -9,23 +9,26 @@ export declare function getOptionsFromGithub(options: {
9
9
  globalConfigFile?: string;
10
10
  sourceBranch?: string;
11
11
  }): Promise<{
12
- accessToken?: string | undefined;
12
+ githubToken?: string | undefined;
13
13
  assignees?: string[] | undefined;
14
14
  author?: string | null | undefined;
15
15
  autoAssign?: boolean | undefined;
16
- autoFixConflicts?: import("../../../../options/config-options.js").AutoFixConflictsHandler | undefined;
16
+ autoFixConflicts?: import("../../../../options/option-schema.js").AutoFixConflictsHandler | undefined;
17
17
  autoMerge?: boolean | undefined;
18
- autoMergeMethod?: string | undefined;
18
+ autoMergeMethod?: "merge" | "rebase" | "squash" | undefined;
19
19
  backportBinary?: string | undefined;
20
20
  backportBranchName?: string | undefined;
21
- cherrypickRef?: boolean | undefined;
22
- commitConflicts?: boolean | undefined;
23
- autoResolveConflictsWithTheirs?: boolean | undefined;
21
+ branchLabelMapping?: Record<string, string> | undefined;
22
+ cherryPickRef?: boolean | undefined;
23
+ conflictResolution?: "commit" | "abort" | "theirs" | undefined;
24
24
  commitPaths?: string[] | undefined;
25
25
  copySourcePRLabels?: string | boolean | string[] | undefined;
26
26
  copySourcePRReviewers?: boolean | undefined;
27
- details?: boolean | undefined;
28
- dir?: string | undefined;
27
+ cwd?: string | undefined;
28
+ since?: string | null | undefined;
29
+ until?: string | null | undefined;
30
+ verbose?: boolean | undefined;
31
+ workdir?: string | undefined;
29
32
  draft?: boolean | undefined;
30
33
  dryRun?: boolean | undefined;
31
34
  editor?: string | undefined;
@@ -36,18 +39,21 @@ export declare function getOptionsFromGithub(options: {
36
39
  githubActionRunId?: number | undefined;
37
40
  githubApiBaseUrlV3?: string | undefined;
38
41
  githubApiBaseUrlV4?: string | undefined;
42
+ globalConfigFile?: string | undefined;
39
43
  interactive?: boolean | undefined;
40
44
  logFilePath?: string | undefined;
45
+ mainline?: number | undefined;
41
46
  ls?: boolean | undefined;
42
- maxNumber?: number | undefined;
43
- multiple?: boolean | undefined;
47
+ maxCount?: number | undefined;
44
48
  multipleBranches?: boolean | undefined;
45
49
  multipleCommits?: boolean | undefined;
46
50
  noVerify?: boolean | undefined;
51
+ noUnmergedBackportsHelp?: boolean | undefined;
52
+ onlyMissing?: boolean | undefined;
47
53
  prDescription?: string | undefined;
48
- prFilter?: string | undefined;
49
- projectConfigFile?: string | undefined;
54
+ prQuery?: string | undefined;
50
55
  prTitle?: string | undefined;
56
+ projectConfigFile?: string | undefined;
51
57
  publishStatusCommentOnAbort?: boolean | undefined;
52
58
  publishStatusCommentOnFailure?: boolean | undefined;
53
59
  publishStatusCommentOnSuccess?: boolean | undefined;
@@ -60,20 +66,37 @@ export declare function getOptionsFromGithub(options: {
60
66
  sha?: string | string[] | undefined;
61
67
  signoff?: boolean | undefined;
62
68
  skipRemoteConfig?: boolean | undefined;
63
- noUnmergedBackportsHelp?: boolean | undefined;
64
69
  sourceBranch: string;
65
70
  sourcePRLabels?: string[] | undefined;
66
- targetBranchChoices?: import("../../../../options/config-options.js").TargetBranchChoiceOrString[] | undefined;
71
+ targetBranchChoices?: (string | {
72
+ name: string;
73
+ value?: string | undefined;
74
+ checked?: boolean | undefined;
75
+ })[] | undefined;
67
76
  targetBranches?: string[] | undefined;
68
77
  targetPRLabels?: string[] | undefined;
69
78
  help?: boolean | undefined;
70
79
  version?: boolean | undefined;
71
80
  v?: boolean | undefined;
72
- branchLabelMapping?: Record<string, string> | undefined;
81
+ accessToken?: string | undefined;
73
82
  upstream?: string | undefined;
74
- branches?: import("../../../../options/config-options.js").TargetBranchChoiceOrString[] | undefined;
83
+ branches?: (string | {
84
+ name: string;
85
+ value?: string | undefined;
86
+ checked?: boolean | undefined;
87
+ })[] | undefined;
75
88
  labels?: string[] | undefined;
76
89
  addOriginalReviewers?: boolean | undefined;
90
+ commitConflicts?: boolean | undefined;
91
+ autoResolveConflictsWithTheirs?: boolean | undefined;
92
+ maxNumber?: number | undefined;
93
+ prFilter?: string | undefined;
94
+ dateSince?: string | undefined;
95
+ dateUntil?: string | undefined;
96
+ dir?: string | undefined;
97
+ cherrypickRef?: boolean | undefined;
98
+ details?: boolean | undefined;
99
+ all?: boolean | undefined;
77
100
  authenticatedUsername: string;
78
101
  isRepoPrivate: boolean | undefined;
79
102
  }>;
@@ -4,9 +4,9 @@ import { getLocalConfigFileCommitDate, isLocalConfigFileUntracked, isLocalConfig
4
4
  import { logger } from '../../../logger.js';
5
5
  import { parseRemoteConfigFile, isMissingConfigFileException, } from '../../../remote-config.js';
6
6
  import { graphqlRequest } from '../client/graphql-client.js';
7
- import { getInvalidAccessTokenMessage } from '../get-invalid-access-token-message.js';
7
+ import { getInvalidGithubTokenMessage } from '../get-invalid-github-token-message.js';
8
8
  export async function getOptionsFromGithub(options) {
9
- const { accessToken, githubApiBaseUrlV4, repoName, repoOwner, globalConfigFile, } = options;
9
+ const { githubToken, githubApiBaseUrlV4, repoName, repoOwner, globalConfigFile, } = options;
10
10
  const query = graphql(`
11
11
  query GithubConfigOptions($repoOwner: String!, $repoName: String!) {
12
12
  viewer {
@@ -29,18 +29,19 @@ export async function getOptionsFromGithub(options) {
29
29
  }
30
30
  `);
31
31
  const variables = { repoOwner, repoName };
32
- const result = await graphqlRequest({ accessToken, githubApiBaseUrlV4 }, query, variables);
32
+ const result = await graphqlRequest({ githubToken, githubApiBaseUrlV4 }, query, variables);
33
33
  if (result.error) {
34
- const isInvalidAccessTokenMessage = getInvalidAccessTokenMessage({
34
+ const invalidGithubTokenMessage = getInvalidGithubTokenMessage({
35
35
  result,
36
36
  repoName,
37
37
  repoOwner,
38
38
  globalConfigFile,
39
+ githubToken,
39
40
  });
40
- if (isInvalidAccessTokenMessage) {
41
+ if (invalidGithubTokenMessage) {
41
42
  throw new BackportError({
42
43
  code: 'invalid-credentials-exception',
43
- message: isInvalidAccessTokenMessage,
44
+ message: invalidGithubTokenMessage,
44
45
  });
45
46
  }
46
47
  if (!isMissingConfigFileException(result)) {
@@ -69,7 +70,7 @@ export async function getOptionsFromGithub(options) {
69
70
  if (!data) {
70
71
  throw new BackportError({
71
72
  code: 'config-error-exception',
72
- message: 'Failed to fetch options from GitHub. Please check your access token and repository settings.',
73
+ message: 'Failed to fetch options from GitHub. Please check your GitHub token and repository settings.',
73
74
  });
74
75
  }
75
76
  return {
@@ -108,8 +109,8 @@ async function getRemoteConfigFileOptions(res, cwd, skipRemoteConfig) {
108
109
  return;
109
110
  }
110
111
  if (localCommitDate &&
111
- localCommitDate > Date.parse(remoteConfig.committedDate)) {
112
- logger.info(`Remote config: Skipping. Local config is newer: ${new Date(localCommitDate).toISOString()} > ${remoteConfig.committedDate}`);
112
+ localCommitDate > Date.parse(String(remoteConfig.committedDate))) {
113
+ logger.info(`Remote config: Skipping. Local config is newer: ${new Date(localCommitDate).toISOString()} > ${String(remoteConfig.committedDate)}`);
113
114
  return;
114
115
  }
115
116
  }
@@ -121,13 +122,13 @@ function getInsufficientPermissionsErrorMessage(res) {
121
122
  if (accessScopesHeader == null) {
122
123
  return;
123
124
  }
124
- const accessTokenScopes = new Set(accessScopesHeader.split(',').map((scope) => scope.trim()));
125
+ const tokenScopes = new Set(accessScopesHeader.split(',').map((scope) => scope.trim()));
125
126
  const isRepoPrivate = res.data?.repository?.isPrivate;
126
- if (isRepoPrivate && !accessTokenScopes.has('repo')) {
127
- return `You must grant the "repo" scope to your personal access token`;
127
+ if (isRepoPrivate && !tokenScopes.has('repo')) {
128
+ return `You must grant the "repo" scope to your GitHub token`;
128
129
  }
129
- if (!accessTokenScopes.has('repo') && !accessTokenScopes.has('public_repo')) {
130
- return `You must grant the "repo" or "public_repo" scope to your personal access token`;
130
+ if (!tokenScopes.has('repo') && !tokenScopes.has('public_repo')) {
131
+ return `You must grant the "repo" or "public_repo" scope to your GitHub token`;
131
132
  }
132
133
  }
133
134
  //# sourceMappingURL=get-options-from-github.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-options-from-github.js","sourceRoot":"","sources":["../../../../../../src/lib/github/v4/getOptionsFromGithub/get-options-from-github.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAA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AAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAC3D,CAAC;IAEF,MAAM,aAAa,GAAG,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC;IAEtD,IAAI,aAAa,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACpD,OAAO,+DAA+D,CAAC;IACzE,CAAC;IAED,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAC5E,OAAO,gFAAgF,CAAC;IAC1F,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"get-options-from-github.js","sourceRoot":"","sources":["../../../../../../src/lib/github/v4/getOptionsFromGithub/get-options-from-github.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAUtF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAS1C;IACC,MAAM,EACJ,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,GAAG,OAAO,CAAC;IAEZ,MAAM,KAAK,GAAG,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;GAoBrB,CAAC,CAAC;IAEH,MAAM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CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAChE,OAAO,uEAAuE,CAAC;IACjF,CAAC;AACH,CAAC"}
@@ -12,7 +12,7 @@ export { fetchPullRequestAutoMergeMethod } from './fetch-pull-request-auto-merge
12
12
  export { enablePullRequestAutoMerge } from './enable-pull-request-auto-merge.js';
13
13
  export { disablePullRequestAutoMerge } from './disable-pull-request-auto-merge.js';
14
14
  export { fetchAuthorId } from './fetch-author-id.js';
15
- export { getInvalidAccessTokenMessage } from './get-invalid-access-token-message.js';
15
+ export { getInvalidGithubTokenMessage } from './get-invalid-github-token-message.js';
16
16
  export { getRepoOwnerAndNameFromGitRemotes } from './get-repo-owner-and-name-from-git-remotes.js';
17
17
  export { getOptionsFromGithub } from './getOptionsFromGithub/get-options-from-github.js';
18
18
  export type { OptionsFromGithub } from './getOptionsFromGithub/get-options-from-github.js';
@@ -15,7 +15,7 @@ export { enablePullRequestAutoMerge } from './enable-pull-request-auto-merge.js'
15
15
  export { disablePullRequestAutoMerge } from './disable-pull-request-auto-merge.js';
16
16
  // Auth & config
17
17
  export { fetchAuthorId } from './fetch-author-id.js';
18
- export { getInvalidAccessTokenMessage } from './get-invalid-access-token-message.js';
18
+ export { getInvalidGithubTokenMessage } from './get-invalid-github-token-message.js';
19
19
  export { getRepoOwnerAndNameFromGitRemotes } from './get-repo-owner-and-name-from-git-remotes.js';
20
20
  export { getOptionsFromGithub } from './getOptionsFromGithub/get-options-from-github.js';
21
21
  // Validation
@@ -1,4 +1,3 @@
1
- import { PullRequestState } from '../../../../graphql/generated/graphql.js';
2
1
  export const commitsByAuthorMock = {
3
2
  repository: {
4
3
  ref: {
@@ -113,7 +112,7 @@ export const commitsByAuthorMock = {
113
112
  },
114
113
  url: 'https://github.com/elastic/kibana/pull/99',
115
114
  title: 'some title',
116
- state: PullRequestState.Merged,
115
+ state: 'MERGED',
117
116
  number: 99,
118
117
  baseRefName: '6.3',
119
118
  commits: {
@@ -1 +1 @@
1
- {"version":3,"file":"commits-by-author-mock.js","sourceRoot":"","sources":["../../../../../../src/lib/github/v4/mocks/commits-by-author-mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD,UAAU,EAAE;QACV,GAAG,EAAE;YACH,MAAM,EAAE;gBACN,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE;gCACJ,UAAU,EAAE,QAAQ;gCACpB,MAAM,EAAE;oCACN,KAAK,EAAE,uBAAuB;oCAC9B,IAAI,EAAE,mBAAmB;iCAC1B;gCACD,UAAU,EAAE;oCACV,IAAI,EAAE,QAAQ;oCACd,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;iCAC5B;gCACD,aAAa,EAAE,sBAAsB;gCACrC,GAAG,EAAE,0CAA0C;gCAC/C,OAAO,EAAE,QAAQ;gCACjB,sBAAsB,EAAE;oCACtB,KAAK,EAAE,EAAE;iCACV;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE;gCACJ,UAAU,EAAE,QAAQ;gCACpB,MAAM,EAAE;oCACN,KAAK,EAAE,uBAAuB;oCAC9B,IAAI,EAAE,mBAAmB;iCAC1B;gCACD,UAAU,EAAE;oCACV,IAAI,EAAE,QAAQ;oCACd,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;iCAC5B;gCACD,aAAa,EAAE,sBAAsB;gCACrC,GAAG,EAAE,0CAA0C;gCAC/C,OAAO,EAAE,iBAAiB;gCAC1B,sBAAsB,EAAE;oCACtB,KAAK,EAAE;wCACL;4CACE,IAAI,EAAE;gDACJ,KAAK,EAAE,sBAAsB;gDAC7B,GAAG,EAAE,2CAA2C;gDAChD,WAAW,EAAE,QAAQ;gDACrB,MAAM,EAAE;oDACN,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;i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;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"commits-by-author-mock.js","sourceRoot":"","sources":["../../../../../../src/lib/github/v4/mocks/commits-by-author-mock.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD,UAAU,EAAE;QACV,GAAG,EAAE;YACH,MAAM,EAAE;gBACN,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE;gCACJ,UAAU,EAAE,QAAQ;gCACpB,MAAM,EAAE;oCACN,KAAK,EAAE,uBAAuB;oCAC9B,IAAI,EAAE,mBAAmB;iCAC1B;gCACD,UAAU,EAAE;oCACV,IAAI,EAAE,QAAQ;oCACd,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;iCAC5B;gCACD,aAAa,EAAE,sBAAsB;gCACrC,GAAG,EAAE,0CAA0C;gCAC/C,OAAO,EAAE,QAAQ;gCACjB,sBAAsB,EAAE;oCACtB,KAAK,EAAE,EAAE;iCACV;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE;gCACJ,UAAU,EAAE,QAAQ;gCACpB,MAAM,EAAE;oCACN,KAAK,EAAE,uBAAuB;oCAC9B,IAAI,EAAE,mBAAmB;iCAC1B;gCACD,UAAU,EAAE;oCACV,IAAI,EAAE,QAAQ;oCACd,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;iCAC5B;gCACD,aAAa,EAAE,sBAAsB;gCACrC,GAAG,EAAE,0CAA0C;gCAC/C,OAAO,EAAE,iBAAiB;gCAC1B,sBAAsB,EAAE;oCACtB,KAAK,EAAE;wCACL;4CACE,IAAI,EAAE;gDACJ,KAAK,EAAE,sBAAsB;gDAC7B,GAAG,EAAE,2CAA2C;gDAChD,WAAW,EAAE,QAAQ;gDACrB,MAAM,EAAE;oDACN,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;iDAChC;gDAC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F;CACF,CAAC"}
@@ -5,8 +5,8 @@ export interface TargetBranchResponse {
5
5
  } | null;
6
6
  };
7
7
  }
8
- export declare function validateTargetBranch({ accessToken, repoName, repoOwner, branchName, githubApiBaseUrlV4, interactive, }: {
9
- accessToken: string;
8
+ export declare function validateTargetBranch({ githubToken, repoName, repoOwner, branchName, githubApiBaseUrlV4, interactive, }: {
9
+ githubToken: string;
10
10
  repoOwner: string;
11
11
  repoName: string;
12
12
  branchName: string;
@@ -2,7 +2,7 @@ import { graphql } from '../../../graphql/generated/index.js';
2
2
  import { BackportError } from '../../backport-error.js';
3
3
  import { ora } from '../../ora.js';
4
4
  import { graphqlRequest } from './client/graphql-client.js';
5
- export async function validateTargetBranch({ accessToken, repoName, repoOwner, branchName, githubApiBaseUrlV4 = 'https://api.github.com/graphql', interactive, }) {
5
+ export async function validateTargetBranch({ githubToken, repoName, repoOwner, branchName, githubApiBaseUrlV4 = 'https://api.github.com/graphql', interactive, }) {
6
6
  const query = graphql(`
7
7
  query GetBranchId(
8
8
  $repoOwner: String!
@@ -18,7 +18,7 @@ export async function validateTargetBranch({ accessToken, repoName, repoOwner, b
18
18
  `);
19
19
  const spinner = ora(interactive, '').start();
20
20
  const variables = { repoOwner, repoName, branchName };
21
- const result = await graphqlRequest({ accessToken, githubApiBaseUrlV4 }, query, variables);
21
+ const result = await graphqlRequest({ githubToken, githubApiBaseUrlV4 }, query, variables);
22
22
  if (result.error) {
23
23
  throw new BackportError({
24
24
  code: 'github-api-exception',
@@ -1,12 +1,12 @@
1
1
  import winston from 'winston';
2
2
  export declare let logger: winston.Logger;
3
- export declare function initLogger({ interactive, accessToken, logFilePath, }: {
3
+ export declare function initLogger({ interactive, githubToken, logFilePath, }: {
4
4
  interactive: boolean;
5
- accessToken?: string;
5
+ githubToken?: string;
6
6
  logFilePath?: string;
7
7
  }): winston.Logger;
8
8
  export declare function consoleLog(message: string): void;
9
- export declare function setAccessToken(accessToken: string): void;
10
- export declare function redactAccessToken(str: string): string;
11
- export declare function accessTokenReplacer(key: string, value: unknown): unknown;
9
+ export declare function setGithubToken(githubToken: string): void;
10
+ export declare function redactGithubToken(str: string): string;
11
+ export declare function githubTokenReplacer(key: string, value: unknown): unknown;
12
12
  export type LogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug';
@@ -6,10 +6,10 @@ export let logger = winston.createLogger({
6
6
  fileTransport({ logLevel: 'debug' }),
7
7
  ],
8
8
  });
9
- let _accessToken;
9
+ let _githubToken;
10
10
  let _interactive;
11
- export function initLogger({ interactive, accessToken, logFilePath, }) {
12
- _accessToken = accessToken;
11
+ export function initLogger({ interactive, githubToken, logFilePath, }) {
12
+ _githubToken = githubToken;
13
13
  _interactive = interactive;
14
14
  logger = winston.createLogger({
15
15
  format: format.combine(format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
@@ -30,26 +30,26 @@ function fileTransport({ logFilePath, logLevel, }) {
30
30
  return new winston.transports.File({
31
31
  filename: getLogfilePath({ logFilePath, logLevel }),
32
32
  level: logLevel,
33
- format: format.json({ replacer: accessTokenReplacer }),
33
+ format: format.json({ replacer: githubTokenReplacer }),
34
34
  });
35
35
  }
36
36
  // wrapper around console.log
37
37
  export function consoleLog(message) {
38
38
  if (_interactive) {
39
- console.log(redactAccessToken(message));
39
+ console.log(redactGithubToken(message));
40
40
  }
41
41
  }
42
- export function setAccessToken(accessToken) {
43
- _accessToken = accessToken;
42
+ export function setGithubToken(githubToken) {
43
+ _githubToken = githubToken;
44
44
  }
45
- export function redactAccessToken(str) {
46
- // `redactAccessToken` might be called before access token is set
47
- if (_accessToken) {
48
- return str.replaceAll(_accessToken, '<REDACTED>');
45
+ export function redactGithubToken(str) {
46
+ // `redactGithubToken` might be called before github token is set
47
+ if (_githubToken) {
48
+ return str.replaceAll(_githubToken, '<REDACTED>');
49
49
  }
50
50
  return str;
51
51
  }
52
- export function accessTokenReplacer(key, value) {
53
- return typeof value === 'string' ? redactAccessToken(value) : value;
52
+ export function githubTokenReplacer(key, value) {
53
+ return typeof value === 'string' ? redactGithubToken(value) : value;
54
54
  }
55
55
  //# sourceMappingURL=logger.js.map
@@ -2,6 +2,95 @@ import type { RemoteConfigHistoryFragmentFragment } from '../graphql/generated/g
2
2
  import type { OperationResultWithMeta } from './github/v4/client/graphql-client.js';
3
3
  type RemoteConfigNode = NonNullable<NonNullable<RemoteConfigHistoryFragmentFragment['remoteConfigHistory']['edges']>[number]>['remoteConfig'];
4
4
  export declare const RemoteConfigHistoryFragment: import("@graphql-typed-document-node/core").TypedDocumentNode<RemoteConfigHistoryFragmentFragment, unknown>;
5
- export declare function parseRemoteConfigFile(remoteConfig: RemoteConfigNode): import("../entrypoint.api.js").ConfigFileOptions | undefined;
5
+ export declare function parseRemoteConfigFile(remoteConfig: RemoteConfigNode): {
6
+ githubToken?: string | undefined;
7
+ assignees?: string[] | undefined;
8
+ author?: string | null | undefined;
9
+ autoAssign?: boolean | undefined;
10
+ autoFixConflicts?: import("../options/option-schema.js").AutoFixConflictsHandler | undefined;
11
+ autoMerge?: boolean | undefined;
12
+ autoMergeMethod?: "merge" | "rebase" | "squash" | undefined;
13
+ backportBinary?: string | undefined;
14
+ backportBranchName?: string | undefined;
15
+ branchLabelMapping?: Record<string, string> | undefined;
16
+ cherryPickRef?: boolean | undefined;
17
+ conflictResolution?: "commit" | "abort" | "theirs" | undefined;
18
+ commitPaths?: string[] | undefined;
19
+ copySourcePRLabels?: string | boolean | string[] | undefined;
20
+ copySourcePRReviewers?: boolean | undefined;
21
+ cwd?: string | undefined;
22
+ since?: string | null | undefined;
23
+ until?: string | null | undefined;
24
+ verbose?: boolean | undefined;
25
+ workdir?: string | undefined;
26
+ draft?: boolean | undefined;
27
+ dryRun?: boolean | undefined;
28
+ editor?: string | undefined;
29
+ fork?: boolean | undefined;
30
+ gitAuthorEmail?: string | undefined;
31
+ gitAuthorName?: string | undefined;
32
+ gitHostname?: string | undefined;
33
+ githubActionRunId?: number | undefined;
34
+ githubApiBaseUrlV3?: string | undefined;
35
+ githubApiBaseUrlV4?: string | undefined;
36
+ globalConfigFile?: string | undefined;
37
+ interactive?: boolean | undefined;
38
+ logFilePath?: string | undefined;
39
+ mainline?: number | undefined;
40
+ ls?: boolean | undefined;
41
+ maxCount?: number | undefined;
42
+ multipleBranches?: boolean | undefined;
43
+ multipleCommits?: boolean | undefined;
44
+ noVerify?: boolean | undefined;
45
+ noUnmergedBackportsHelp?: boolean | undefined;
46
+ onlyMissing?: boolean | undefined;
47
+ prDescription?: string | undefined;
48
+ prQuery?: string | undefined;
49
+ prTitle?: string | undefined;
50
+ projectConfigFile?: string | undefined;
51
+ publishStatusCommentOnAbort?: boolean | undefined;
52
+ publishStatusCommentOnFailure?: boolean | undefined;
53
+ publishStatusCommentOnSuccess?: boolean | undefined;
54
+ pullNumber?: number | number[] | undefined;
55
+ repoForkOwner?: string | undefined;
56
+ repoName?: string | undefined;
57
+ repoOwner?: string | undefined;
58
+ resetAuthor?: boolean | undefined;
59
+ reviewers?: string[] | undefined;
60
+ sha?: string | string[] | undefined;
61
+ signoff?: boolean | undefined;
62
+ skipRemoteConfig?: boolean | undefined;
63
+ sourceBranch?: string | undefined;
64
+ sourcePRLabels?: string[] | undefined;
65
+ targetBranchChoices?: (string | {
66
+ name: string;
67
+ value?: string | undefined;
68
+ checked?: boolean | undefined;
69
+ })[] | undefined;
70
+ targetBranches?: string[] | undefined;
71
+ targetPRLabels?: string[] | undefined;
72
+ help?: boolean | undefined;
73
+ version?: boolean | undefined;
74
+ v?: boolean | undefined;
75
+ accessToken?: string | undefined;
76
+ upstream?: string | undefined;
77
+ branches?: (string | {
78
+ name: string;
79
+ value?: string | undefined;
80
+ checked?: boolean | undefined;
81
+ })[] | undefined;
82
+ labels?: string[] | undefined;
83
+ addOriginalReviewers?: boolean | undefined;
84
+ commitConflicts?: boolean | undefined;
85
+ autoResolveConflictsWithTheirs?: boolean | undefined;
86
+ maxNumber?: number | undefined;
87
+ prFilter?: string | undefined;
88
+ dateSince?: string | undefined;
89
+ dateUntil?: string | undefined;
90
+ dir?: string | undefined;
91
+ cherrypickRef?: boolean | undefined;
92
+ details?: boolean | undefined;
93
+ all?: boolean | undefined;
94
+ } | undefined;
6
95
  export declare function isMissingConfigFileException(result: OperationResultWithMeta<unknown>): boolean;
7
96
  export {};
@@ -40,7 +40,7 @@ export async function runSequentially({ options, commits, targetBranches, }) {
40
40
  }
41
41
  return;
42
42
  }
43
- consoleLog(`An unhandled error occurred while backporting commit. Please see the logs for details: ${getLogfilePath({ logFilePath: options.logFilePath, logLevel: 'info' })}`);
43
+ consoleLog(`An unhandled error occurred while backporting commit. Re-run with --verbose for details or see the logfile: ${getLogfilePath({ logFilePath: options.logFilePath, logLevel: 'info' })}`);
44
44
  }
45
45
  });
46
46
  return results;
@@ -1 +1 @@
1
- {"version":3,"file":"run-sequentially.js","sourceRoot":"","sources":["../../../src/lib/run-sequentially.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oCAAoC,EAAE,MAAM,qFAAqF,CAAC;AAC3I,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAoBtD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EACpC,OAAO,EACP,OAAO,EACP,cAAc,GAKf;IACC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAE5C,MAAM,OAAO,GAAG,EAAc,CAAC;IAE/B,MAAM,YAAY,CAAC,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;QACxD,MAAM,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,YAAY,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,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CAAC,qBAAqB,CAAC;YACpE,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;YAEtE,OAAO,CAAC,IAAI,CAAC;gBACX,MAAM,EAAE,OAAO;gBACf,YAAY;gBACZ,YAAY;gBACZ,SAAS;gBACT,YAAY;aACb,CAAC,CAAC;YAEH,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;YAE9C,IAAI,eAAe,EAAE,CAAC;gBACpB,IAAI,SAAS,KAAK,0BAA0B,EAAE,CAAC;oBAC7C,UAAU,CAAC,YAAY,CAAC,CAAC;gBAC3B,CAAC;gBACD,OAAO;YACT,CAAC;YAED,UAAU,CACR,+GAA+G,cAAc,CAC3H,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CACvD,EAAE,CACJ,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -20,7 +20,7 @@ export async function setupRepo(options) {
20
20
  const localRepoPath = await getLocalSourceRepoPath(options);
21
21
  const remoteRepoPath = getRemoteUrl(options, options.repoOwner);
22
22
  const sourcePath = localRepoPath ?? remoteRepoPath;
23
- // show the full path for local repos, but only the host name for remote repos (to avoid showing the access token)
23
+ // show the full path for local repos, but only the host name for remote repos (to avoid showing the github token)
24
24
  const sourcePathHumanReadable = localRepoPath
25
25
  ? sourcePath
26
26
  : options.gitHostname;
@@ -40,7 +40,7 @@ export async function setupRepo(options) {
40
40
  }
41
41
  // delete default "origin" remote to avoid confusion
42
42
  await deleteRemote(options, 'origin');
43
- // ensure remote are setup with latest accessToken
43
+ // ensure remote are setup with latest githubToken
44
44
  await deleteRemote(options, options.repoForkOwner);
45
45
  await addRemote(options, options.repoForkOwner);
46
46
  // add remote for non-fork repo (if the above is a fork)
@@ -31,12 +31,12 @@ export function getPullRequestStates({ sourceCommit, branchLabelMapping, }) {
31
31
  return {
32
32
  ...res,
33
33
  state: 'MERGED',
34
- url: sourcePullRequest.url,
34
+ url: String(sourcePullRequest.url),
35
35
  number: sourcePullRequest.number,
36
36
  mergeCommit: sourcePullRequest.mergeCommit
37
37
  ? {
38
38
  message: sourcePullRequest.mergeCommit.message,
39
- sha: sourcePullRequest.mergeCommit.sha,
39
+ sha: String(sourcePullRequest.mergeCommit.sha),
40
40
  }
41
41
  : undefined,
42
42
  };
@@ -83,13 +83,13 @@ function getCreatedTargetPullRequests(sourceCommit) {
83
83
  .map((item) => {
84
84
  const { targetPullRequest } = item.node;
85
85
  return {
86
- url: targetPullRequest.url,
86
+ url: String(targetPullRequest.url),
87
87
  number: targetPullRequest.number,
88
88
  branch: targetPullRequest.baseRefName,
89
89
  state: targetPullRequest.state,
90
90
  mergeCommit: targetPullRequest.targetMergeCommit
91
91
  ? {
92
- sha: targetPullRequest.targetMergeCommit.sha,
92
+ sha: String(targetPullRequest.targetMergeCommit.sha),
93
93
  message: targetPullRequest.targetMergeCommit.message,
94
94
  }
95
95
  : undefined,