Skip to content

Commit

Permalink
Consistent inputs across woke-action and woke-action-reviewdog
Browse files Browse the repository at this point in the history
  • Loading branch information
caitlinelfring committed Aug 27, 2020
1 parent 43b1139 commit 0b7e911
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "test-action"
name: Test
on:
pull_request:
push:
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand All @@ -33,8 +35,13 @@ Inputs to configure the `woke` GitHub Actions.

| Input | Default | Description |
|------------------|-----------------------|---------------------------------------------------------------------------------------------------|
| `args` | `.` | (Optional) Additional flags to run woke with (see <https://github.com/caitlinelfring/woke#usage>) |
| `fail-on-error` | `false` | (Optional) Fail the GitHub Actions check for any failures. |
| `woke_args` | `.` | (Optional) Additional flags to run woke with (see <https://github.com/caitlinelfring/woke#usage>) |
| `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).
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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
Expand All @@ -30,12 +30,12 @@ runs:
- run: $GITHUB_ACTION_PATH/entrypoint.sh
shell: bash
env:
WOKE_VERSION: ${{ inputs.version }}
# INPUT_<VARIABLE_NAME> 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'
Expand Down
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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::'

0 comments on commit 0b7e911

Please sign in to comment.