Skip to content

Commit

Permalink
GitHub actions. New default value: table (#68)
Browse files Browse the repository at this point in the history
The README.md file has been updated to reflect that the default report
format for GitHub Actions is now 'table' instead of 'github'. This
change has been applied consistently across the documentation, ensuring
clearer understanding and more consistency for the users.
  • Loading branch information
SmetDenis authored Mar 20, 2024
1 parent 1e54664 commit 8faf35a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ You can find launch examples in the [workflow demo](https://github.com/JBZoo/Csv
# Required: true
schema: ./tests/schema.yml

# Report format. Available options: text, table, github, gitlab, teamcity, junit
# Default value: github
# Report format. Available options: text, table, github, gitlab, teamcity, junit.
# Default value: table
# You can skip it
report: github
report: table

# Quick mode. It will not validate all rows. It will stop after the first error.
# Default value: no
Expand All @@ -405,7 +405,7 @@ You can find launch examples in the [workflow demo](https://github.com/JBZoo/Csv
```
<!-- /github-actions-yml -->

**Note**. GitHub Actions report format is `github` by default. See [GitHub Actions friendly](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) and [PR as a live demo](https://github.com/JBZoo/Csv-Blueprint-Demo/pull/1/files).
**Note**. GitHub Actions report format is `table` by default. See [GitHub Actions friendly](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) and [PR as a live demo](https://github.com/JBZoo/Csv-Blueprint-Demo/pull/1/files).

This allows you to see bugs in the GitHub interface at the PR level.
That is, the error will be shown in a specific place in the CSV file right in diff of your Pull Requests! [See example](https://github.com/JBZoo/Csv-Blueprint-Demo/pull/1/files).
Expand Down Expand Up @@ -586,7 +586,7 @@ Optional format `text` with highlited keywords:


**Notes**
* Report format for GitHub Actions is `github` by default.
* Report format for GitHub Actions is `table` by default.
* Tools uses [JBZoo/CI-Report-Converter](https://github.com/JBZoo/CI-Report-Converter) as SDK to convert reports to different formats. So you can easily integrate it with any CI system.


Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ inputs:
description: 'Schema filepath. It can be a YAML, JSON or PHP. See examples on GitHub.'
required: true
report:
description: 'Report format. Available options: text, table, github, gitlab, teamcity, junit'
default: github
description: 'Report format. Available options: text, table, github, gitlab, teamcity, junit.'
default: table
required: true
quick:
description: 'Quick mode. It will not validate all rows. It will stop after the first error.'
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ValidateCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function configure(): void
InputOption::VALUE_REQUIRED,
"Report output format. Available options:\n" .
'<info>' . \implode(', ', ErrorSuite::getAvaiableRenderFormats()) . '</info>',
ErrorSuite::RENDER_TABLE,
ErrorSuite::REPORT_DEFAULT,
)
->addOption(
'quick',
Expand Down
1 change: 1 addition & 0 deletions src/Validators/ErrorSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ final class ErrorSuite
public const REPORT_GITLAB = 'gitlab';
public const REPORT_GITHUB = 'github';
public const REPORT_JUNIT = 'junit';
public const REPORT_DEFAULT = self::RENDER_TABLE;

/** @var Error[] */
private array $errors = [];
Expand Down
4 changes: 2 additions & 2 deletions tests/GithubActionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testCreateCsvHelp(): void

isSame(
$action->findString('inputs.report.description'),
'Report format. Available options: ' . \implode(', ', ErrorSuite::getAvaiableRenderFormats()),
'Report format. Available options: ' . \implode(', ', ErrorSuite::getAvaiableRenderFormats()) . '.',
);
}

Expand All @@ -52,7 +52,7 @@ public function testGitHubActionsReadMe(): void
$examples = [
'csv' => './tests/**/*.csv',
'schema' => './tests/schema.yml',
'report' => 'github',
'report' => ErrorSuite::REPORT_DEFAULT,
'quick' => 'no',
'skip-schema' => 'no',
];
Expand Down

0 comments on commit 8faf35a

Please sign in to comment.