From 66994cbcbd39a7df12816c4cd73dfbe62f8fc6d7 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 10 May 2023 11:34:15 +0200 Subject: [PATCH] fix(action): try to test it --- .github/workflows/ci.yaml | 5 +++++ Dockerfile | 2 +- src/github-action.ts | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bbca52ca..e780ac1a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,3 +44,8 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage/cobertura-coverage.xml + + - name: Test github action + uses: ./ + with: + token: ${{ secrets.SPECFY_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 64be4a67..bda857dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,4 +61,4 @@ COPY --from=tmp --chown=node:node /app/tmp /app EXPOSE 8080 -ENTRYPOINT ["node", "./dist/github-action.js"] +ENTRYPOINT ["node", "/app/dist/github-action.js"] diff --git a/src/github-action.ts b/src/github-action.ts index f61b5017..7b2d3ef2 100644 --- a/src/github-action.ts +++ b/src/github-action.ts @@ -1,10 +1,27 @@ import core from '@actions/core'; +import { analyser, FSProvider } from './index.js'; + try { + console.log('Starting Stack Analyser'); + const token = core.getInput('token', { required: true, }); + const workspace = process.env.GITHUB_WORKSPACE!; console.log('hello', token); + console.log('workspace', workspace); + + const res = await analyser({ + provider: new FSProvider({ + path: workspace, + ignorePaths: [], + }), + }); + + console.log('Result:', res.toJson(workspace)); + + console.log('Done'); } catch (error: unknown) { if (error instanceof Error) { core.setFailed(error.message);