Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ used to sidestep the problem where pull requests are rejected by GitHub if the f

Filters all merge requests and issues by these labels. The applicable values can be found in the Gitlab API documentation for [issues](https://docs.gitlab.com/ee/api/issues.html#list-project-issues) and [merge requests](https://docs.gitlab.com/ee/api/merge_requests.html#list-merge-requests) respectively. Default is `null` which returns all issues/merge requests.

### skipMergeRequestStates

Merge requests in GitLab with any of the states listed in this array will not be transferred to GitHub (e.g. set to `['merged', 'closed']` to avoid creating issues for closed MRs whose branches have been deleted).

### skipMatchingComments

This is an array (empty per default) that may contain string values. Any note/comment in any issue, that contains one or more of those string values, will be skipped (meaining not migrated). Note that this is case insensitive, therefore the string value `foo` would also lead to skipping notes containing a (sub)string `FOO`.
Expand Down
1 change: 1 addition & 0 deletions sample_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default {
useReplacementIssuesForCreationFails: true,
useIssuesForAllMergeRequests: false,
filterByLabel: null,
skipMergeRequestStates: [],
skipMatchingComments: [],
mergeRequests: {
logFile: './merge-requests.json',
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ async function transferMergeRequests() {
i => i.title.trim().includes(request.title.trim())
);
if (!githubRequest && !githubIssue) {
if (settings.skipMergeRequestStates.includes(request.state)) {
console.log(`Skipping MR ${request.iid} in "${request.state}" state: ${request.title}`)
continue;
}
console.log(
'Creating pull request: !' + request.iid + ' - ' + request.title
);
Expand Down
1 change: 1 addition & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default interface Settings {
useReplacementIssuesForCreationFails: boolean;
useIssuesForAllMergeRequests: boolean;
filterByLabel: string | null;
skipMergeRequestStates: string[];
skipMatchingComments: string[];
mergeRequests: {
logFile: string;
Expand Down