Skip to content

Commit

Permalink
fix(action): try to test it
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed May 10, 2023
1 parent c0542d9 commit 66994cb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
17 changes: 17 additions & 0 deletions src/github-action.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down

0 comments on commit 66994cb

Please sign in to comment.