diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml index 43a231c..ee060dd 100644 --- a/.github/workflows/action-test.yml +++ b/.github/workflows/action-test.yml @@ -12,17 +12,26 @@ on: jobs: - test: + Test: runs-on: ubuntu-latest + env: + HTML5_ACTION_DEBUG: true steps: - - name: No checkout test - uses: Cyb3r-Jak3/html5validator-action@master + # Need to manually change branch when making changes + - name: No checkout test. Fail at Git Check + uses: Cyb3r-Jak3/html5validator-action@allow_git_check_skipping with: root: tests/valid/ continue-on-error: true - env: - HTML5_ACTION_DEBUG: true + + # Need to manually change branch when making changes + - name: No checkout test. Passes at Git Check + uses: Cyb3r-Jak3/html5validator-action@allow_git_check_skipping + with: + root: tests/valid/ + skip_git_check: true + continue-on-error: true - uses: actions/checkout@v2 @@ -30,8 +39,6 @@ jobs: uses: ./ with: root: tests/valid/ - env: - HTML5_ACTION_DEBUG: true - name: Testing Options id: valid @@ -42,16 +49,12 @@ jobs: log_level: INFO extra: -lll css: true - env: - HTML5_ACTION_DEBUG: true - name: Test config id: config uses: ./ with: config: tests/example_config.yaml - env: - HTML5_ACTION_DEBUG: true - name: Check Blacklist id: blacklist @@ -59,8 +62,6 @@ jobs: with: root: tests/ blacklist: invalid - env: - HTML5_ACTION_DEBUG: true - name: Check Failure id: invalid @@ -69,8 +70,6 @@ jobs: root: tests/invalid/ log_level: INFO css: true - env: - HTML5_ACTION_DEBUG: true continue-on-error: true - name: Check Empty @@ -79,8 +78,6 @@ jobs: with: log_level: INFO css: true - env: - HTML5_ACTION_DEBUG: true continue-on-error: true - uses: actions/upload-artifact@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 746180f..4b85fbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog +## [Not Released] + +### Adds + +* Ability to skip the git checkout check + ## [v0.7.0] - 2021-11-03 ### Adds diff --git a/README.md b/README.md index 2a9d0ef..a3c9915 100644 --- a/README.md +++ b/README.md @@ -9,35 +9,17 @@ For help getting started, check out the [wiki](https://github.com/Cyb3r-Jak3/htm ## Inputs -### `root` - -The root path of the files you want to check. - -### `config` - -The path to the config file. - -### `extra` - -Additional arguments to pass to html5validator. - -### `format` - -The format for logging. Supported values: `json, xml, gnu, text`. - -### `log_level` - -The log level to use. Supported values: `DEBUG, INFO, WARNING`. Default: `WARNING`. - -### `css` - -Enable to check css. Supported values: `true, false`. Default: `false`. - -### `blacklist` - -The names of files or directories to blacklist. - -**These are not full paths.** +| Flag | Description | Default | +|------------------|-------------------------------------------------------------------------------|-----------| +| `root` | The root path of the files you want to check | | +| `config` | Path to config file to use. | | +| `format` | The format for logging. Supported values: `json, xml, gnu, text`. | | +| `log_level` | The log level to use. Supported values: `DEBUG, INFO, WARNING`. | `WARNING` | +| `css` | Enable to check css. Supported values: `true, false` | `false` | +| `blacklist`* | The names of files or directories to blacklist. **These are not full paths.** | | +| `skip_git_check` | Skip checking that the repo has been checked out | | + +* Examples of `blacklist` Correct Example: diff --git a/action.yml b/action.yml index 1d252c5..7f09c72 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: description: "Extra arguments to test with" required: false format: - description: "Format for logging output. Valid values: gnu,xml,json,text" + description: "Format for logging output. Valid values: gnu, xml, json, text" required: false log_level: description: "Logging Level. Valid values: DEBUG, INFO, WARNING. Default: WARNING" @@ -27,6 +27,10 @@ inputs: blacklist: description: "Files or directories to ignore in checking" required: false + skip_git_check: + description: "Skip checking that code has been checked out" + required: false + default: false outputs: result: description: 'The exit code' diff --git a/entrypoint.sh b/entrypoint.sh index e5b1fdf..a3cf890 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,7 +16,7 @@ function main() { fi echo "Running Validator" - if ! git -C . rev-parse 2>/dev/null; then + if ! git -C . rev-parse 2>/dev/null && ! usesBoolean "${INPUT_SKIP_GIT_CHECK}"; then echo ::set-output name=result::"There is no git respository detected" echo ::error::"There is no git respository detected" exit 1