-
Notifications
You must be signed in to change notification settings - Fork 119
Add check for non-inclusive language; Clean up / Workaround non-inclusive words #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| The MIT License (MIT) | ||
|
|
||
| Copyright © 2020 Caitlin Elfring <celfring@gmail.com> | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # woke-action | ||
|
|
||
| [](https://github.com/get-woke/woke-action/releases) | ||
|
|
||
| Woke GitHub Actions allow you to execute [`woke`](https://github.com/get-woke/woke) command within GitHub Actions. | ||
|
|
||
| The output of the actions can be viewed from the Actions tab in the main repository view. | ||
|
|
||
| ## Usage | ||
|
|
||
| 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`). | ||
|
|
||
| ```yaml | ||
| name: woke | ||
| on: | ||
| - pull_request | ||
| jobs: | ||
| woke: | ||
| name: woke | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: woke | ||
| uses: get-woke/woke-action@v0 | ||
| with: | ||
| # Cause the check to fail on any broke rules | ||
| fail-on-error: true | ||
| ``` | ||
|
|
||
| ## Inputs | ||
|
|
||
| Inputs to configure the `woke` GitHub Actions. | ||
|
|
||
| | Input | Default | Description | | ||
| |------------------|-----------------------|---------------------------------------------------------------------------------------------------| | ||
| | `woke-args` | `.` | (Optional) Additional flags to run woke with (see <https://github.com/get-woke/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. | | ||
| | `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/get-woke/woke-action/blob/main/LICENSE). | ||
|
|
||
| ## Only Changed Files | ||
|
|
||
| If you're interested in only running `woke` against files that have changed in a PR, | ||
| 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: | ||
|
|
||
| ```yaml | ||
|
|
||
| name: 'woke' | ||
| on: | ||
| - pull_request | ||
| jobs: | ||
| woke: | ||
| name: 'woke' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - uses: jitterbit/get-changed-files@v1 | ||
| id: files | ||
|
|
||
| - name: 'woke' | ||
| uses: get-woke/woke-action@v0 | ||
| with: | ||
| # Cause the check to fail on any broke rules | ||
| fail-on-error: true | ||
| # See https://github.com/marketplace/actions/get-all-changed-files | ||
| # for more options | ||
| woke-args: ${{ steps.files.outputs.added_modified }} | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| 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: | ||
| description: 'GITHUB_TOKEN' | ||
| required: true | ||
| default: ${{ github.token }} | ||
| woke-args: | ||
| description: 'woke arguments' | ||
| default: '.' | ||
| required: false | ||
| fail-on-error: | ||
| description: | | ||
| Exit code when errors are found [true,false] | ||
| Default is `false`. | ||
| default: 'false' | ||
| required: false | ||
| workdir: | ||
| description: 'Working directory relative to the root directory.' | ||
| default: '.' | ||
| required: false | ||
| woke-version: | ||
| description: >- | ||
| woke version, defaults to the latest `v0` version. | ||
| Override to pin to a specific version | ||
| default: 'v0' | ||
| required: false | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - run: $GITHUB_ACTION_PATH/entrypoint.sh | ||
| shell: bash | ||
| env: | ||
| # 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_VERSION: ${{ inputs.woke-version }} | ||
| INPUT_WOKE_ARGS: ${{ inputs.woke-args }} | ||
| INPUT_FAIL_ON_ERROR: ${{ inputs.fail-on-error }} | ||
| INPUT_WORKDIR: ${{ inputs.workdir }} | ||
| branding: | ||
| icon: 'check-circle' | ||
| color: 'gray-dark' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
| # shellcheck disable=SC2086 | ||
|
|
||
| set -e | ||
|
|
||
| cd "${GITHUB_WORKSPACE}/${INPUT_WORKDIR}" || exit 1 | ||
|
|
||
| TEMP_PATH="$(mktemp -d)" | ||
| PATH="${TEMP_PATH}:$PATH" | ||
|
|
||
| echo '::group:: Installing woke ... https://github.com/nhosoi/woke' | ||
| curl https://raw.githubusercontent.com/nhosoi/woke/main/woke -o "${TEMP_PATH}/woke" | ||
| chmod 0755 "${TEMP_PATH}/woke" | ||
| echo '::endgroup::' | ||
|
|
||
| echo '::group:: Running woke ...' | ||
| woke \ | ||
| --output github-actions \ | ||
| --exit-1-on-failure="${INPUT_FAIL_ON_ERROR:-false}" \ | ||
| ${INPUT_WOKE_ARGS} | ||
| echo '::endgroup::' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| I have a whitelist and a blacklist. What should I do about it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # yamllint disable rule:line-length | ||
| name: Check for non-inclusive language | ||
| on: # yamllint disable-line rule:truthy | ||
| - pull_request | ||
| jobs: | ||
| woke: | ||
| name: woke | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: custom woke | ||
| # Originally, uses: get-woke/woke-action@v0 | ||
| uses: ./.github/actions/custom-woke-action | ||
| with: | ||
| woke-args: "-c https://raw.githubusercontent.com/linux-system-roles/tox-lsr/main/src/tox_lsr/config_files/woke.yml --count-only-error-for-failure" | ||
| # Cause the check to fail on any broke rules | ||
| fail-on-error: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subject line of this PR may need to be properly adjusted. Because the changes are about workarounding the woke non-inclusive language failure with the
wokeignore: rule=*comment.