Skip to content

Commit 4f679c3

Browse files
committed
[#15] - Fix #15 and remove 'pr-comment' trigger as not functional
Signed-off-by: michmich112 <[email protected]>
1 parent 26c0436 commit 4f679c3

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ interface BumpRule {
242242
/**
243243
* Action that triggers the bump to occur
244244
*/
245-
trigger: 'commit' | 'pull-request' | 'pr-comment' | 'manual',
245+
trigger: 'commit' | 'pull-request' | 'manual',
246246
247247
}
248248
```

dist/rules/tests/isRuleApplicable.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('[ RULE ] - isRuleApplicable', () => {
5050
const rule = {
5151
trigger: 'commit',
5252
};
53-
const trigger = 'pr-comment';
53+
const trigger = 'manual';
5454
const branch = 'randomBranch';
5555
expect(isRuleApplicable_1.default(rule, trigger, branch)).toBe(false);
5656
});

dist/utils/options.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ function getTrigger() {
241241
return 'commit';
242242
case 'pull_request':
243243
return 'pull-request';
244-
case 'pull_request_review_comment':
245-
return 'pr-comment';
244+
// case 'pull_request_review_comment':
245+
// return 'pr-comment';
246246
case 'workflow_dispatch':
247247
return 'manual';
248248
default:
249-
console.warn("Event trigger not of type: commit, pull request or pr-comment.");
249+
console.warn("Event trigger not of type: commit, pull request or manual.");
250250
throw new Error("Invalid trigger event");
251251
}
252252
}

src/lib/types/OptionsFile.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface BumpRule {
6868
* Comment that triggers the rule
6969
* Only used when the trigger is pr-comment
7070
*/
71-
comment?: string,
71+
// comment?: string,
7272

7373
/**
7474
* Allows the bumper to create a commit tag for the bump
@@ -103,7 +103,7 @@ export interface BumpRule {
103103
}
104104

105105
export type VersionScheme = 'custom' | any;
106-
export type RuleTrigger = 'commit' | 'pull-request' | 'pr-comment' | 'manual';
106+
export type RuleTrigger = 'commit' | 'pull-request' | 'manual'; //| 'pr-comment'
107107
export type VersionReleaseStatus = 'alpha' | 'beta' | 'release-candidate' | 'release';
108108
export type Seperators = '.' | ',' | ';' | ':' | '-' | '_' | '>' | '<';
109109
export const seperators: Seperators[] = ['.' , ',' , ';' , ':' , '-' , '_' , '>' , '<'];

src/rules/tests/isRuleApplicable.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('[ RULE ] - isRuleApplicable', () => {
5151
const rule: BumpRule = {
5252
trigger: 'commit',
5353
};
54-
const trigger: RuleTrigger = 'pr-comment';
54+
const trigger: RuleTrigger = 'manual';
5555
const branch = 'randomBranch';
5656
expect(isRuleApplicable(rule, trigger, branch)).toBe(false);
5757
});

src/utils/options.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { bumpVersion, getCurVersion, getSchemeRegex, getTag } from "./utils";
66
import * as core from '@actions/core';
77
import * as github from '@actions/github';
88
import * as fs from "fs";
9-
import { triggerAsyncId } from 'async_hooks';
10-
119

1210
/**
1311
* Normalizes options by associating the scheme if user has selected a preset scheme
@@ -203,12 +201,12 @@ export function getTrigger(): RuleTrigger {
203201
return 'commit';
204202
case 'pull_request':
205203
return 'pull-request';
206-
case 'pull_request_review_comment':
207-
return 'pr-comment';
204+
// case 'pull_request_review_comment':
205+
// return 'pr-comment';
208206
case 'workflow_dispatch':
209207
return 'manual';
210208
default:
211-
console.warn("Event trigger not of type: commit, pull request or pr-comment.");
209+
console.warn("Event trigger not of type: commit, pull request or manual.");
212210
throw new Error("Invalid trigger event");
213211
}
214212
}

0 commit comments

Comments
 (0)