GitHub Action that checks code and docs for offensive / exclusive terms and provides warnings.

Overview

Inclusiveness Analyzer

Make your code inclusive!

The Inclusiveness Analyzer is a GitHub action that checks your repository for offensive / exclusive terms.

It also provides context on why a word is exclusive and suggests alternate terms that can be used instead.

Install Guide

Add Inclusive Analyzer action to your build workflow

  • In your GitHub repository, select the Actions tab and either add or edit a workflow.
  • Search for Inclusiveness Analyzer from the Marketplace tab on the right.
  • Copy and paste the yaml into your workflow. Screenshot showing Inclusiveness Analyzer being added to a build.

Copy paste the following workflow definition into your project .github/workflows/inclusiveness-analyzer.yml

# This workflow checks out code and scans the content changed or added in the 
# last commit for offensive / exclusive terms.
# The scan will provide context on the found terms and alternatvies that can be
# used instead.

name: Inclusiveness Analyser scan

on:
  push:
  workflow_dispatch:

jobs:
  Inclusiveness-Analyser-scan:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - name: Inclusiveness Analyser scan
      uses: microsoft/[email protected]
  • Commit your changes to trigger the workflow or run the workflow manually
  • The Annotations view will show the first ten non-inclusive terms that are found.
  • You can select the Jobs detail log to view all the instances of non-inclusive terms. Screenshot showing Inclusiveness Analyzer warning of the work blacklist being used.

Action configuration options

Use the options below to configure exclusions and build state when non-inclusive terms are found in the repository.

option example description
failOnNonInclusiveTerm If false (Default) the build completes successfully and warnings are provided in the logs.
If true the build is failed if non-inclusive terms are found.
excludeUnchangedFiles If true (Default) limits the scan to files changed in the latest commit.
If false a full scan is run on each commit.
excludeFiles **/skipme.txt,**/donotscan/* Comma separated list of file patterns to exclude from analysis. Glob patterns are supported with a prefix of **/
excludeTerms he,she Comma separated list of non-inclusive terms to exclude from analysis.

Inclusiveness Analyzer for other Platforms

About the project

As humans, we hold many unconscious and implicit biases that we rely on to react quickly to our environment and any novel stimuli. However, since the unconscious brain processes and reacts with speed, we sometimes speak quickly without thinking, which may cause us to slip offensive terms and stereotypes although we mean no malice.

In order to confront these biases that we see in ourselves and others, we must rewire ourselves to regularly use inclusive practices (such as the words we speak). If you don't intentionally and proactively include, you will unintentionally exclude.

Join our effort to push out exclusive terms and make inclusive terms a part of our everyday vocabulary!

Help us confront these biases by pushing out exclusive terms and making inclusive terms a part of our everyday vocabulary!

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Comments
  • Error on intial commit to existing repo

    Error on intial commit to existing repo

    I'm not sure if this is because it's only scanning files added during the last commit (which only contains addition of this GitHub Action):

    # This workflow checks out code and scans the content changed or added in the 
    # last commit for offensive / exclusive terms.
    # The scan will provide context on the found terms and alternatvies that can be
    # used instead.
    
    name: Inclusiveness Analyser scan
    
    on:
      push:
      workflow_dispatch:
    
    jobs:
      Inclusiveness-Analyser-scan:
        runs-on: ubuntu-latest
        steps:
        - name: Checkout code
          uses: actions/checkout@v3
    
        - name: Inclusiveness Analyzer
          uses: microsoft/[email protected]
          with:
            # Fails the step if a non-inclusive term is found
            failOnNonInclusiveTerm: false
            # Only scan files added or modified in last commit when checkout step has "with: fetch-depth: 2" configured
            excludeUnchangedFiles: true
    

    I'm getting the following error from the action:

    Run microsoft/[email protected]
    Notice: Inclusiveness Analyzer
    Notice: - Scanning files added or modified in last commit
    Error: ENOENT: no such file or directory, stat
    
    opened by jimbudarz 10
  • Removed git show filter to avoid empty list errors

    Removed git show filter to avoid empty list errors

    Any filtering on git show can result in an empty list of changed files, and then a failure of the check. To include more types of commits, the only ignored files will be deleted files (hence the lower-case d). Addresses Issue #31

    opened by jimbudarz 4
  • Warning should be issued for full word matches only.

    Warning should be issued for full word matches only.

    In the example below a warning is raised for the term 'he' against the word 'heart'.

    This is a false flag. The scan should be for the whole word.

    In the VS plug-in we ignore matches if the word length is less than five characters. We could do the same here or use an alternate approach. Ideally it would be good to keep the logic in sync.

            /// <summary>
            /// Checks if term was found in the symbol.
            /// Match whole word if it has less than 5 characters
            /// </summary>
            /// <param name="symbol">The phrase that is being checked.</param>
            /// <param name="term">The non-inclusive phrase we are looking for.</param>
            /// <returns></returns>
            private static bool IsMatch(string symbol, string term)
            {
                return term.Length < 5 ?
                    symbol.Equals(term, StringComparison.InvariantCultureIgnoreCase) :
                    symbol.IndexOf(term, StringComparison.InvariantCultureIgnoreCase) >= 0;
                
            }
    

    Source: https://github.com/microsoft/InclusivenessAnalyzerVisualStudio/blob/main/src/InclusivenessAnalyzer/InclusivenessAnalyzer/InclusivenessAnalyzer.cs#L139

    Warning: Found the term 'he', consider using alternatives: they
      Warning: 	[Line 4]     description: 'Fails the step if a non-inclusive term is found'
      Warning: 	[Line 1[8](https://github.com/microsoft/InclusivenessAnalyzer/actions/runs/3086984421/jobs/4991883279#step:5:9)]   icon: 'heart'
      Warning: Found the term 'his', consider using alternatives: their,theirs
    
    opened by merill 1
  • scan last commited files

    scan last commited files

    Scan files added or changed in last commit.

    Additional boolean parameter added "lastCommit" defaulted to false.

    Files found via "git log"

    Exclusion checked via minimatch (checked on all found files and all exclusions patterns)

    Moved exclusions parameter processing to action.js (used in both get files from directory and commit)

    Use readBoolean for boolean parameters (needs to be inputed in local test as defaults are not accounted)

    opened by cblomart 0
  • update to allow local testing

    update to allow local testing

    set the value for the parameters on package.json: "scripts": { "local": "cross-env GITHUB_WORKSPACE=/temp/test INPUT_EXCLUDETERMS=he,she node src/action.js",

    use the following to test locally: npm run local

    opened by marcusca10 0
  • Get warnings if `failOnNonInclusiveTerm: true`

    Get warnings if `failOnNonInclusiveTerm: true`

    Hi, I've just noticed that users can either get a failure during the check or detailed warnings which indicate where the problematic language is. Is it possible to get the warnings in the logs, even when the action has failed status? image

    I'm using version 1.0.1.

    Full logs when failOnNonInclusiveTerm: true: https://github.com/jimbudarz/american-pollution/actions/runs/3525855417/jobs/5913079896

    Full logs when failOnNonInclusiveTerm: false: https://github.com/jimbudarz/american-pollution/actions/runs/3525885803/jobs/5913148114

    opened by jimbudarz 3
Releases(v1.0.1)
Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
Hundreds of Offensive and Useful Docker Images for Network Intrusion. The name says it all.

?? HOUDINI: Hundreds of Offensive and Useful Docker Images for Network Intrusion HOUDINI is a curated list of Network Security related Docker Images f

SecSI 1.1k Dec 31, 2022
A lightweight extension to automatically detect and provide verbose warnings for embedded iframe elements in order to protect against Browser-In-The-Browser (BITB) attacks.

Enhanced iFrame Protection - Browser Extension Enhanced iFrame Protection (EIP) is a lightweight extension to automatically detect and provide verbose

odacavo 16 Dec 24, 2022
Play logic games and claim exclusive NFTs!

Bit Gaming Samruk Hackathon Winner ?? Play-to-earn DAO with exclusive NFT collection Idea We are bringing together curious minds and reward them with

Temirzhan Yussupov 3 Jun 21, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
This repository is exclusive to javascript bootcamp, organized at GDSC TIU. Maintained by Gourav Ghosal

JAVASCRIPT BOOTCAMP This repository is exclusive to javascript bootcamp, organized at GDSC TIU. An introductory resource by Gourav Ghosal, Chapter Lea

DSC TIU 15 Nov 26, 2022
A GitHub Action that allows to debug GitHub workflows using VS Code.

VS Code Server Action A GitHub Action that allows to debug GitHub workflows using VS Code. Failing CI builds can be annoying especially since we don't

stateful 18 Dec 23, 2022
Jargon from the functional programming world in simple terms!

Functional Programming Jargon Functional programming (FP) provides many advantages, and its popularity has been increasing as a result. However, each

hemanth.hm 18.1k Jan 4, 2023
A github action that provides detailed bundle analysis on PRs for next.js apps

Next.js Bundle Analysis Github Action Analyzes each PR's impact on your next.js app's bundle size and displays it using a comment. Optionally supports

HashiCorp 369 Dec 27, 2022
A to-do list Web application that lets the user add, remove and reorder to do lists and checks a task when completed with a button to delete all completed task

TO DO LISTS A Web application that lets the user add, remove and reorder to do lists Built With Html,JS,CSS Webpack and other dependencies Git, Github

Promise Okechukwu 14 Nov 1, 2022
🚀 A Node.js server that automaticaly finds and checks proxies for you.

Proxi A Node.js app that automaticaly finds and checks proxies for you and shows them on a dashboard. Install & Setup ## Download git clone https://gi

Jareer Abdullah 8 Jul 7, 2022
Awesome book with ES6, this project is build using HTML,CSS, JavaScript ES6 the project allows you to add books and save them with the author , for another time checks

Project Name Awsome books Description the project. adding books daynamiclly Built With Major languages Frameworks Technologies used Live Demo (if avai

Alzubair Alqaraghuli 5 Jul 25, 2022
An implementation of gRPC health checks, for node.js-based apps that uses @grpc/grpc-js as a base.

gRPC Health Check An implementation of gRPC health checks, for node.js-based apps that uses @grpc/grpc-js as a base. Installation yarn add git+https:/

Fonoster 6 Aug 31, 2022
Very tiny function that checks if an object/array/value is shaped like another, with TypeScript type refining.

@suchipi/has-shape Very tiny (~200B before minification/compression) function that checks if an object/array/value is shaped like another, with TypeSc

Lily Skye 7 Aug 13, 2022
GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (istanbul)

GitHub Action: Report NYC coverage GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (ista

Sid 16 Nov 23, 2022
A GitHub action to submit your dependency graph from your Mill build to GitHub.

Mill Dependency Submission A GitHub action to submit your dependency graph from your Mill build to GitHub via their Dependency Submission API. The mai

Chris Kipp 6 Dec 15, 2022
🤖 GitHub Action which creates Issues from comments in your code

todo-issue[action] Disclosure Huge thanks to JasonEtco! After he decided to shut down his todo[bot] I've looked around for alternatives but decided to

Julian 17 Dec 11, 2022