Skip to content

Commit

Permalink
Fixed input options in action
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed May 6, 2021
1 parent 618941b commit d0600c7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ Action allows you to convert errors to the [GitHub Annotations format](https://d
* To learn more [see different examples](.github/workflows/gh-action.yml)

```yaml
- uses: jbzoo/ci-report-converter@2.2.0 # or see the latest version on releases page
- uses: jbzoo/ci-report-converter@master # or see the specific version on releases page
with:
# File path with the original report format. If not set or empty, then the STDIN is used.
# Required: true
input-file: ./build/checkstyle.xml

# Source format. Available options: checkstyle, junit, phpmd-json, phpmnd, pmd-cpd, psalm-json
Expand All @@ -85,6 +86,7 @@ Action allows you to convert errors to the [GitHub Annotations format](https://d
# Set custom name of root group/suite
# Required: true
suite-name: My Tests

```


Expand Down
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ branding:
inputs:
input-file:
description: 'File path with the original report format. If not set or empty, then the STDIN is used.'
required: true
input-format:
description: 'Source format. Available options: checkstyle, junit, phpmd-json, phpmnd, pmd-cpd, psalm-json'
default: checkstyle
Expand Down
6 changes: 6 additions & 0 deletions tests/CliCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function testGitHubActionsYml()
$expectedRunsArgs[] = '-vvv';

$expectedInputs['output-format']['default'] = GithubCliConverter::TYPE;
$expectedInputs['input-file']['required'] = true;
ksort($expectedInputs);

$errorMessage = (string)yml(['inputs' => $expectedInputs]);
Expand All @@ -123,8 +124,11 @@ public function testGitHubActionsReadMe()
];

$expectedMessage = [
'```yaml',
'- uses: jbzoo/ci-report-converter@master # or see the specific version on releases page',
' with:'
];

foreach ($inputs as $key => $input) {
$expectedMessage[] = " # {$input['description']}";

Expand All @@ -140,6 +144,8 @@ public function testGitHubActionsReadMe()
$expectedMessage[] = '';
}

$expectedMessage[] = '```';

isFileContains(implode("\n", $expectedMessage), PROJECT_ROOT . '/README.md');
}

Expand Down

0 comments on commit d0600c7

Please sign in to comment.