Skip to content

Commit

Permalink
Merge pull request #312 from yutailang0119/cleanup/inputs
Browse files Browse the repository at this point in the history
Cleanup inputs
  • Loading branch information
yutailang0119 authored Nov 28, 2021
2 parents 6fb8b87 + da4139d commit 1e160b7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
- uses: actions/checkout@v2
- uses: ./
with:
json-path: ${{ github.workspace }}/__tests__/resource/textlint-report.json
report-path: ${{ github.workspace }}/__tests__/resource/textlint-report.json
continue-on-error: true
2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {expect, test} from '@jest/globals'

// shows how the runner will run a javascript action with env / stdout protocol
test('test runs with json file', () => {
process.env['INPUT_JSON-PATH'] = path.join(
process.env['INPUT_REPORT-PATH'] = path.join(
__dirname,
'resource',
'textlint-report.json'
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: 'GitHub Action for textlint'
description: 'Display textlint result on GitHub'
author: 'Yutaro Muta'
inputs:
json-path:
description: 'The file path of the JSON lint report'
report-path:
description: 'The lint report file path.'
required: false
textlint-output:
description: 'The json format output by textlint'
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ async function run(): Promise<void> {
let json: string
const textlintOutput = core.getInput('textlint-output', {required: false})
if (textlintOutput === '') {
const jsonPath = core.getInput('json-path', {required: false})
json = fs.readFileSync(jsonPath, 'utf-8')
const reportPath = core.getInput('report-path', {required: false})
json = fs.readFileSync(reportPath, 'utf-8')
} else {
json = textlintOutput
}
Expand Down

0 comments on commit 1e160b7

Please sign in to comment.