From c824d144aeaa21d5e911b06ceace93b28bb3a5a0 Mon Sep 17 00:00:00 2001 From: shikajiro Date: Wed, 11 Oct 2023 17:45:07 +0900 Subject: [PATCH 1/2] test commit From 07d2576073a6b8fb89c0f44100bc7c59fc636412 Mon Sep 17 00:00:00 2001 From: shikajiro Date: Wed, 11 Oct 2023 17:53:31 +0900 Subject: [PATCH 2/2] rm ts-jest --- .github/workflows/mention-to-chatwork.yml | 5 ++++- src/domain/github.ts | 3 +-- src/main.ts | 8 +++----- src/model.ts | 5 ++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/mention-to-chatwork.yml b/.github/workflows/mention-to-chatwork.yml index 1512fb7..67264a2 100644 --- a/.github/workflows/mention-to-chatwork.yml +++ b/.github/workflows/mention-to-chatwork.yml @@ -32,9 +32,12 @@ jobs: run: | npm install npm run build + mkdir act + cp -r dist act + cp action.yml act - name: test run - uses: ./ + uses: ./act with: repo-token: ${{ secrets.GITHUB_TOKEN }} api-token: ${{ secrets.CHATWORK_API_TOKEN }} diff --git a/src/domain/github.ts b/src/domain/github.ts index 21cb325..1d028b6 100644 --- a/src/domain/github.ts +++ b/src/domain/github.ts @@ -1,5 +1,4 @@ import { context } from "@actions/github"; -import { stringify } from "ts-jest"; import { WebhookPayload } from "@actions/github/lib/interfaces"; import { convertToChatworkUsername, MappingFile } from "../model"; import * as core from "@actions/core"; @@ -31,7 +30,7 @@ const acceptActionTypes = { }; const buildError = (payload: unknown): Error => { - return new Error(`unknown event hook: ${stringify(payload)}`); + return new Error(`unknown event hook: ${JSON.stringify(payload)}`); }; export const needToSendApproveMention = (payload: WebhookPayload): boolean => { diff --git a/src/main.ts b/src/main.ts index ea8a6ee..6798c3d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,3 @@ -import { stringify } from "ts-jest"; - import * as core from "@actions/core"; import { context } from "@actions/github"; @@ -18,16 +16,16 @@ export const main = async (): Promise => { core.info("start main"); const { payload } = context; - core.info(stringify(payload)); + core.info(JSON.stringify(payload)); const allInputs = getAllInputs(); - core.info(stringify(allInputs)); + core.info(JSON.stringify(allInputs)); const { repoToken, configurationPath, reviewRequest } = allInputs; try { const mapping = await execLoadMapping(configurationPath, repoToken); - core.info(stringify(mapping)); + core.info(JSON.stringify(mapping)); if (reviewRequest) { await execPrReviewRequestedMention(payload, allInputs, mapping); diff --git a/src/model.ts b/src/model.ts index 5a20ce5..ba745c6 100644 --- a/src/model.ts +++ b/src/model.ts @@ -1,5 +1,4 @@ import * as core from "@actions/core"; -import { stringify } from "ts-jest"; export type AllInputs = { repoToken: string; @@ -45,12 +44,12 @@ export const convertToChatworkUsername = ( githubUsernames: string[], mapping: MappingFile, ): Account[] => { - core.info(stringify(githubUsernames)); + core.info(JSON.stringify(githubUsernames)); const slackIds = githubUsernames.map( (githubUsername) => mapping[githubUsername], ); - core.info(stringify(slackIds)); + core.info(JSON.stringify(slackIds)); return slackIds; };