|
| 1 | +# woke-action |
| 2 | + |
| 3 | +[](https://github.com/get-woke/woke-action/releases) |
| 4 | + |
| 5 | +Woke GitHub Actions allow you to execute [`woke`](https://github.com/get-woke/woke) command within GitHub Actions. |
| 6 | + |
| 7 | +The output of the actions can be viewed from the Actions tab in the main repository view. |
| 8 | + |
| 9 | +## Usage |
| 10 | + |
| 11 | +The most common usage is to run `woke` on a file/directory. This workflow can be configured by adding the following content to the GitHub Actions workflow YAML file (ie in `.github/workflows/woke.yaml`). |
| 12 | + |
| 13 | +```yaml |
| 14 | +name: woke |
| 15 | +on: |
| 16 | + - pull_request |
| 17 | +jobs: |
| 18 | + woke: |
| 19 | + name: woke |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v2 |
| 24 | + |
| 25 | + - name: woke |
| 26 | + uses: get-woke/woke-action@v0 |
| 27 | + with: |
| 28 | + # Cause the check to fail on any broke rules |
| 29 | + fail-on-error: true |
| 30 | +``` |
| 31 | +
|
| 32 | +## Inputs |
| 33 | +
|
| 34 | +Inputs to configure the `woke` GitHub Actions. |
| 35 | + |
| 36 | +| Input | Default | Description | |
| 37 | +|------------------|-----------------------|---------------------------------------------------------------------------------------------------| |
| 38 | +| `woke-args` | `.` | (Optional) Additional flags to run woke with (see <https://github.com/get-woke/woke#usage>) | |
| 39 | +| `woke-version` | latest | (Optional) Release version of `woke` (defaults to latest version) | |
| 40 | +| `fail-on-error` | `false` | (Optional) Fail the GitHub Actions check for any failures. | |
| 41 | +| `workdir` | `.` | (Optional) Run `woke` this working directory relative to the root directory. | |
| 42 | +| `github-token` | `${{ github.token }}` | (Optional) Custom GitHub Access token (ie `${{ secrets.MY_CUSTOM_TOKEN }}`). | |
| 43 | + |
| 44 | +## License |
| 45 | + |
| 46 | +This application is licensed under the MIT License, you may obtain a copy of it |
| 47 | +[here](https://github.com/get-woke/woke-action/blob/main/LICENSE). |
| 48 | + |
| 49 | +## Only Changed Files |
| 50 | + |
| 51 | +If you're interested in only running `woke` against files that have changed in a PR, |
| 52 | +consider something like [Get All Changed Files Action](https://github.com/marketplace/actions/get-all-changed-files). With this, you can add a workflow that looks like: |
| 53 | + |
| 54 | +```yaml |
| 55 | +
|
| 56 | +name: 'woke' |
| 57 | +on: |
| 58 | + - pull_request |
| 59 | +jobs: |
| 60 | + woke: |
| 61 | + name: 'woke' |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - name: 'Checkout' |
| 65 | + uses: actions/checkout@v2 |
| 66 | +
|
| 67 | + - uses: jitterbit/get-changed-files@v1 |
| 68 | + id: files |
| 69 | +
|
| 70 | + - name: 'woke' |
| 71 | + uses: get-woke/woke-action@v0 |
| 72 | + with: |
| 73 | + # Cause the check to fail on any broke rules |
| 74 | + fail-on-error: true |
| 75 | + # See https://github.com/marketplace/actions/get-all-changed-files |
| 76 | + # for more options |
| 77 | + woke-args: ${{ steps.files.outputs.added_modified }} |
| 78 | +``` |
0 commit comments