From 0b7e911a399ef762244dab4f932bca885b052bff Mon Sep 17 00:00:00 2001 From: Caitlin Elfring Date: Thu, 27 Aug 2020 19:37:14 -0400 Subject: [PATCH] Consistent inputs across woke-action and woke-action-reviewdog --- .github/workflows/test.yaml | 2 +- README.md | 17 ++++++++++++----- action.yml | 16 ++++++++-------- entrypoint.sh | 6 +++--- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e3801f9..62de57a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: "test-action" +name: Test on: pull_request: push: diff --git a/README.md b/README.md index 9f54147..e6ccbf6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # woke-action +[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/caitlinelfring/woke-action?logo=github&sort=semver)](https://github.com/caitlinelfring/woke-action/releases) + Woke GitHub Actions allow you to execute [`woke`](https://github.com/caitlinelfring/woke) command within GitHub Actions. The output of the actions can be viewed from the Actions tab in the main repository view. @@ -24,7 +26,7 @@ jobs: uses: caitlinelfring/woke-action@master with: # Cause the check to fail on any broke rules - fail-on-error: true + fail_on_error: true ``` ## Inputs @@ -33,8 +35,13 @@ Inputs to configure the `woke` GitHub Actions. | Input | Default | Description | |------------------|-----------------------|---------------------------------------------------------------------------------------------------| -| `args` | `.` | (Optional) Additional flags to run woke with (see ) | -| `fail-on-error` | `false` | (Optional) Fail the GitHub Actions check for any failures. | +| `woke_args` | `.` | (Optional) Additional flags to run woke with (see ) | +| `woke_version` | latest | (Optional) Release version of `woke` (defaults to latest version) | +| `fail_on_error` | `false` | (Optional) Fail the GitHub Actions check for any failures. | | `workdir` | `.` | (Optional) Run `woke` this working directory relative to the root directory. | -| `version` | latest | (Optional) Release version of `woke` (defaults to latest version) | -| `github-token` | `${{ github.token }}` | (Optional) Custom GitHub Access token (ie `${{ secrets.MY_CUSTOM_TOKEN }}`). | +| `github_token` | `${{ github.token }}` | (Optional) Custom GitHub Access token (ie `${{ secrets.MY_CUSTOM_TOKEN }}`). | + +## License + +This application is licensed under the MIT License, you may obtain a copy of it +[here](https://github.com/caitlinelfring/woke-action-reviewdog/blob/main/LICENSE). diff --git a/action.yml b/action.yml index 03387da..3cca1bd 100644 --- a/action.yml +++ b/action.yml @@ -2,15 +2,15 @@ name: 'Run woke' description: 'Run woke on pull requests to detect non-inclusive language in your source code.' author: 'Caitlin Elfring (caitlinelfring)' inputs: - github-token: + github_token: description: 'GITHUB_TOKEN' required: true default: ${{ github.token }} - args: + woke_args: description: 'woke arguments' default: '.' required: false - fail-on-error: + fail_on_error: description: | Exit code when errors are found [true,false] Default is `false`. @@ -20,7 +20,7 @@ inputs: description: 'Working directory relative to the root directory.' default: '.' required: false - version: + woke_version: description: 'woke version' default: '' # uses latest, should be pinned? # 'v0.1' required: false @@ -30,12 +30,12 @@ runs: - run: $GITHUB_ACTION_PATH/entrypoint.sh shell: bash env: - WOKE_VERSION: ${{ inputs.version }} # INPUT_ is not available in Composite run steps # https://github.com/actions/runner/issues/665 - INPUT_GITHUB_TOKEN: ${{ inputs.github-token }} - INPUT_WOKE_FLAGS: ${{ inputs.woke-flags }} - INPUT_FAIL_ON_ERROR: ${{ inputs.fail-on-error }} + INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} + INPUT_WOKE_VERSION: ${{ inputs.version }} + INPUT_WOKE_FLAGS: ${{ inputs.woke_args }} + INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} INPUT_WORKDIR: ${{ inputs.workdir }} branding: icon: 'check-circle' diff --git a/entrypoint.sh b/entrypoint.sh index 2c3205e..23f1ebf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,12 +6,12 @@ TEMP_PATH="$(mktemp -d)" PATH="${TEMP_PATH}:$PATH" echo '::group:: Installing woke ... https://github.com/caitlinelfring/woke' -curl -sfL https://raw.githubusercontent.com/caitlinelfring/woke/main/install.sh | sh -s -- -b "${TEMP_PATH}" "${WOKE_VERSION}" 2>&1 +curl -sfL https://raw.githubusercontent.com/caitlinelfring/woke/main/install.sh | sh -s -- -b "${TEMP_PATH}" "${INPUT_WOKE_VERSION}" 2>&1 echo '::endgroup::' echo '::group:: Running woke ...' woke \ - --output simple \ + --output github-actions \ --exit-1-on-failure="${INPUT_FAIL_ON_ERROR:-false}" - ${INPUT_WOKE_FLAGS} + ${INPUT_WOKE_ARGS} echo '::endgroup::'