Skip to content

Commit 7616e77

Browse files
committed
chore: rename
1 parent 8183021 commit 7616e77

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ inputs:
55
file_glob:
66
required: true
77
description: The file path to lint with Spectral
8+
default: '*.oas.{json,yml,yaml}'
89
spectral_ruleset:
910
required: true
1011
description: Ruleset file to load in Spectral
12+
default: 'spectral:oas'
13+
repo_token:
14+
required: true
15+
description: Ruleset file to load in Spectral
1116
runs:
1217
using: docker
1318
image: Dockerfile

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { DiagnosticSeverity } from '@stoplight/types';
33
import { warning } from '@actions/core';
44
import { EOL } from 'os';
55
import { promises as fs } from 'fs';
6-
import { array, flatten } from 'fp-ts/lib/Array';
6+
import { array } from 'fp-ts/lib/Array';
7+
import { flatten } from 'lodash';
78
import { Config } from './config';
89
import { runSpectral, createSpectral } from './spectral';
910
import { createGithubCheck, createOctokitInstance, getRepositoryInfoFromEvent, updateGithubCheck } from './octokit';

src/octokit.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { GitHub } from '@actions/github';
2-
import * as TaskEither from 'fp-ts/lib/TaskEither';
3-
import * as IOEither from 'fp-ts/lib/IOEither';
4-
import * as Either from 'fp-ts/lib/Either';
2+
import * as TE from 'fp-ts/lib/TaskEither';
3+
import * as E from 'fp-ts/lib/Either';
54
import { pipe } from 'fp-ts/lib/pipeable';
65
import { ChecksCreateResponse, ChecksUpdateParamsOutputAnnotations, ChecksUpdateParams, Response } from '@octokit/rest';
76

@@ -14,30 +13,29 @@ type Event = {
1413
};
1514
};
1615

17-
export const createOctokitInstance = (token: string) =>
18-
TaskEither.fromIOEither(IOEither.tryCatch(() => new GitHub(token), Either.toError));
16+
export const createOctokitInstance = (token: string) => TE.fromEither(E.tryCatch(() => new GitHub(token), E.toError));
1917

2018
export const createGithubCheck = (
2119
octokit: GitHub,
2220
event: { owner: string; repo: string },
2321
name: string,
2422
head_sha: string
2523
) =>
26-
TaskEither.tryCatch(
24+
TE.tryCatch(
2725
() =>
2826
octokit.checks.create({
2927
owner: event.owner,
3028
repo: event.repo,
3129
name,
3230
head_sha,
3331
}),
34-
Either.toError
32+
E.toError
3533
);
3634

3735
export const getRepositoryInfoFromEvent = (eventPath: string) =>
3836
pipe(
39-
TaskEither.fromIOEither(IOEither.tryCatch<Error, Event>(() => require(eventPath), Either.toError)),
40-
TaskEither.map(event => {
37+
TE.fromEither(E.tryCatch<Error, Event>(() => require(eventPath), E.toError)),
38+
TE.map(event => {
4139
const { repository } = event;
4240
const {
4341
owner: { login: owner },
@@ -56,7 +54,7 @@ export const updateGithubCheck = (
5654
conclusion: ChecksUpdateParams['conclusion'],
5755
message?: string
5856
) =>
59-
TaskEither.tryCatch(
57+
TE.tryCatch(
6058
() =>
6159
octokit.checks.update({
6260
check_run_id: check.data.id,
@@ -76,5 +74,5 @@ export const updateGithubCheck = (
7674
annotations,
7775
},
7876
}),
79-
Either.toError
77+
E.toError
8078
);

0 commit comments

Comments
 (0)