Skip to content

Commit

Permalink
feat: add debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Apr 24, 2023
1 parent d2cf009 commit 30480c6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -30,6 +30,7 @@ The action's step needs to run after your test suite has outputted an LCOV file.
| `base-path` | _optional_ | Path to the root folder of the project the coverage was collected in. Should be used in monorepos so that coveralls can process the LCOV correctly (e.g. packages/my-project) |
| `git-branch` | _optional_ | Default: GITHUB_REF environment variable. Override the branch name. |
| `git-commit` | _optional_ | Default: GITHUB_SHA environment variable. Override the commit SHA. |
| `debug` | _optional_ | Default: `false`. Set to `true` to enable debug logging. |

### Outputs:

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Expand Up @@ -36,6 +36,10 @@ inputs:
git-commit:
description: 'Override the commit sha'
required: false
debug:
description: 'Enable debug logging'
required: false
default: false
outputs:
coveralls-api-result:
description: 'Result status of Coveralls API post.'
Expand Down
4 changes: 4 additions & 0 deletions dist/index.js
Expand Up @@ -40774,6 +40774,10 @@ function run() {
process.env.COVERALLS_GIT_COMMIT = process.env.GITHUB_SHA.toString();
process.env.COVERALLS_GIT_BRANCH = process.env.GITHUB_REF.toString();
process.env.COVERALLS_FLAG_NAME = process.env.COVERALLS_FLAG_NAME || core.getInput('flag-name');
if (core.getInput('debug')) {
process.env.NODE_COVERALLS_DEBUG = '1';
process.env.COVERALLS_DEBUG = '1';
}
const event = fs_1.default.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8');
if (process.env.COVERALLS_DEBUG) {
console.log("Event Name: " + process.env.GITHUB_EVENT_NAME);
Expand Down
4 changes: 4 additions & 0 deletions src/run.ts
Expand Up @@ -27,6 +27,10 @@ export async function run() {
process.env.COVERALLS_GIT_COMMIT = process.env.GITHUB_SHA!.toString();
process.env.COVERALLS_GIT_BRANCH = process.env.GITHUB_REF!.toString();
process.env.COVERALLS_FLAG_NAME = process.env.COVERALLS_FLAG_NAME || core.getInput('flag-name');
if (core.getInput('debug')) {
process.env.NODE_COVERALLS_DEBUG = '1'
process.env.COVERALLS_DEBUG = '1'
}

const event = fs.readFileSync(process.env.GITHUB_EVENT_PATH!, 'utf8');

Expand Down

0 comments on commit 30480c6

Please sign in to comment.