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);