Skip to content

Commit

Permalink
test(linter): new version 1.3.0 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
luabida authored Dec 14, 2022
1 parent 98cbbf4 commit 6247eb8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
- uses: actions/checkout@v3

- name: Semantic Release PR Title Check
uses: osl-incubator/[email protected].0
uses: osl-incubator/[email protected].1
with:
convention-name: conventionalcommits
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3

- name: Semantic Release PR Title Check
uses: osl-incubator/[email protected].0
uses: osl-incubator/[email protected].1
with: #Optional
convention-name: conventionalcommits #Default: angular
```
Expand Down
24 changes: 12 additions & 12 deletions dist/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.linter = void 0;
const core = __importStar(require("@actions/core"));
const allowedTags = [
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"test",
];
function linter(title) {
let allowedTags = [
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"test",
];
let preset = core.getInput('convention-name');
try {
let splitTitle = extractContext(title, preset);
Expand All @@ -60,7 +60,7 @@ function extractContext(title, preset) {
let matches = title.matchAll(regEx);
try {
let results = Array.from(matches)[0].filter(Boolean).splice(1);
if (results.length === 4 && preset !== 'conventionalcommits') {
if (results.length === 4 && preset !== `conventionalcommits`) {
throw ("- To use '!' in the title, set preset as `convenvionalcommits`");
}
;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "semantic-release-pr-title-check",
"version": "1.3.0",
"version": "1.3.1",
"description": "Checks for [Angular commit message format](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#-commit-message-format) in the Pull Request Title.",
"main": "build/main.js",
"directories": {
Expand Down
26 changes: 13 additions & 13 deletions src/linter.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import * as core from "@actions/core";

const allowedTags = [
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"test",
];


export function linter(title: string) {

let allowedTags = [
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"test",
];

let preset: string = core.getInput('convention-name');

try {
Expand Down Expand Up @@ -43,7 +43,7 @@ function extractContext(title: string, preset: string): string[] {
try {
let results = Array.from(matches)[0].filter(Boolean).splice(1);

if (results.length === 4 && preset !== 'conventionalcommits') {
if (results.length === 4 && preset !== `conventionalcommits`) {
throw("- To use '!' in the title, set preset as `convenvionalcommits`");
};

Expand Down

0 comments on commit 6247eb8

Please sign in to comment.