Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from shikajiro/test
Browse files Browse the repository at this point in the history
test commit
  • Loading branch information
shikajiro authored Oct 11, 2023
2 parents 6358947 + 07d2576 commit 6104d44
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/mention-to-chatwork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 1 addition & 2 deletions src/domain/github.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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 => {
Expand Down
8 changes: 3 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { stringify } from "ts-jest";

import * as core from "@actions/core";
import { context } from "@actions/github";

Expand All @@ -18,16 +16,16 @@ export const main = async (): Promise<void> => {
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);
Expand Down
5 changes: 2 additions & 3 deletions src/model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as core from "@actions/core";
import { stringify } from "ts-jest";

export type AllInputs = {
repoToken: string;
Expand Down Expand Up @@ -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;
};

0 comments on commit 6104d44

Please sign in to comment.