diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index cbcb6e7..8c9b6ff 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -33,10 +33,17 @@ jobs: id: config uses: ./ with: - root: empty config: tests/example_config.yaml action_debug: true + - name: Check Ignore + id: ignore + uses: ./ + with: + root: tests/ + ignore: invalid + action_debug: true + - name: Check Failure id: invalid uses: ./ @@ -67,4 +74,5 @@ jobs: VALID_OUT: ${{ steps.valid.outputs.result }} INVALID_OUT: ${{ steps.invalid.outputs.result }} CONFIG_OUT: ${{ steps.config.outputs.result }} + IGNORE_OUT: ${{ steps.ignore.outputs.result }} EMPTY_OUT: ${{ steps.empty.outputs.result }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b17bb..0080437 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## [v0.5] - 2021-03-27 + +- Adds ignore option to ignore files and directories + ## [v0.4.4] - 2020-12-05 ### Changed diff --git a/README.md b/README.md index b811c06..175d0bf 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,32 @@ Log level to use. Supported values: `DEBUG, INFO, WARNING`. Default: `Warning`. If to check css. Supported values: `true, false`. Default: `false`. +### `Ignore` + +Names of files or directories to ignore. +**This is not full paths** + +Example: +This will work + +```yaml + - name: HTML5Validator + uses: Cyb3r-Jak3/html5validator-action + with: + root: tests/ + ignore: invalid +``` + +This will not + +```yaml + - name: HTML5Validator + uses: Cyb3r-Jak3/html5validator-action + with: + root: tests/ + ignore: tests/invalid +``` + ## Outputs ### `result` @@ -42,7 +68,7 @@ The exit code of the validation. ## Example usage ```yaml - uses: Cyb3r-Jak3/html5validator-action@v0.4.4 + uses: Cyb3r-Jak3/html5validator-action@v0.5 with: root: tests/valid/ ``` diff --git a/action.yml b/action.yml index 536f464..06dc786 100644 --- a/action.yml +++ b/action.yml @@ -24,6 +24,9 @@ inputs: css: description: "Checks css as well" required: false + ignore: + description: "Files or directories to ignore in checking" + required: false action_debug: description: "Flag that increase verbose output only used for troubleshooting the action." required: false diff --git a/entrypoint.sh b/entrypoint.sh index 86dd6fd..d6cb01e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,10 @@ set -e function main() { if usesBoolean "${INPUT_ACTION_DEBUG}"; then set -x + INPUT_LOG_LEVEL=DEBUG + html5validator --version fi + if ! uses "${INPUT_ROOT}" && ! uses "${INPUT_CONFIG}"; then echo "Need either root or config file" echo ::set-output name=result::"no config file or root path given" @@ -18,6 +21,10 @@ function main() { BuildARGS+="--format ${INPUT_FORMAT}" fi + if uses "${INPUT_IGNORE}"; then + BuildARGS+=" --blacklist ${INPUT_IGNORE}" + fi + if usesBoolean "${INPUT_CSS}"; then BuildARGS+=" --also-check-css" fi diff --git a/output_check.sh b/output_check.sh index 75cc4da..f60fa57 100644 --- a/output_check.sh +++ b/output_check.sh @@ -11,6 +11,10 @@ if [[ "$CONFIG_OUT" -ne 0 ]]; then echo "Config step failed" exit 1 fi +if [[ "$IGNORE_OUT" -ne 0 ]]; then + echo "Ignore step failed" + exit 1 +fi if [[ "$EMPTY_OUT" != "no config file or root path given" ]]; then echo "Empty check failed" exit 1;