diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 9f9bd2b19..a7ff947cd 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -11,12 +11,14 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./ + id: cspell-action test-action-with-file: # run the action runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ./ + id: cspell-action with: files: | **/*.ts @@ -27,20 +29,46 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./ + id: cspell-action with: incremental_files_only: false files: | ** .*/** + - name: Show Results + env: + outputs: ${{ toJSON(steps.cspell-action.outputs) }} + run: | + echo "$outputs" test-action-no-increment-verbose: # run the action runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ./ + id: cspell-action with: incremental_files_only: false files: | ** .*/** verbose: true + + test-action-files-with-issues: # run the action + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./ + id: cspell-action + with: + incremental_files_only: false + files: | + fixtures/** + config: ./fixtures/cspell.json + strict: false + inline: none + - name: Show Results + env: + outputs: ${{ toJSON(steps.cspell-action.outputs) }} + run: | + echo "$outputs" diff --git a/README.md b/README.md index 5af4f621f..974dd9123 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,44 @@ const cspell = { module.exports = cspell; ``` +## Outputs + +```yaml +outputs: + success: + description: | + "true" if no spelling issues were found, otherwise "false". + number_of_files_checked: + description: | + The actual number of files that were checked. + number_of_issues: + description: | + The number of issues found. + number_of_files_with_issues: + description: | + The number of files that had issues. + files_with_issues: + description: | + List of files with issues. Use `fromJSON()` to decode. + The files are relative to the repository root. + results: + description: | + The JSON encoded results. +``` + +Example Output: + +```json +{ + "success": "false", + "number_of_files_checked": "3", + "number_of_issues": "2", + "number_of_files_with_issues": "1", + "files_with_issues": "[\"src/withErrors.ts\"]", + "result": "{\"success\":false,\"number_of_issues\":2,\"number_of_files_checked\":3,\"files_with_issues\":[\"src/withErrors.ts\"]}" +} +``` +