{"id":13598872,"url":"https://github.com/charliegerard/safe-space","last_synced_at":"2025-04-06T04:10:07.988Z","repository":{"id":54153577,"uuid":"287943901","full_name":"charliegerard/safe-space","owner":"charliegerard","description":"Github action that checks the toxicity level of comments and PR reviews to help make repos safe spaces.","archived":false,"fork":false,"pushed_at":"2021-06-24T16:59:05.000Z","size":19267,"stargazers_count":474,"open_issues_count":4,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T02:09:54.231Z","etag":null,"topics":["github-actions","javascript","machine-learning","tensorflow","tensorflowjs","tfjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charliegerard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"charliegerard","ko_fi":"devdevcharlie","custom":["https://buymeacoffee.com/devdevcharlie"]}},"created_at":"2020-08-16T12:56:36.000Z","updated_at":"2025-03-13T19:05:22.000Z","dependencies_parsed_at":"2022-08-13T07:50:11.919Z","dependency_job_id":null,"html_url":"https://github.com/charliegerard/safe-space","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliegerard%2Fsafe-space","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliegerard%2Fsafe-space/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliegerard%2Fsafe-space/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charliegerard%2Fsafe-space/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charliegerard","download_url":"https://codeload.github.com/charliegerard/safe-space/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430869,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","javascript","machine-learning","tensorflow","tensorflowjs","tfjs"],"created_at":"2024-08-01T17:00:57.649Z","updated_at":"2025-04-06T04:10:07.888Z","avatar_url":"https://github.com/charliegerard.png","language":"JavaScript","funding_links":["https://github.com/sponsors/charliegerard","https://ko-fi.com/devdevcharlie","https://buymeacoffee.com/devdevcharlie"],"categories":["JavaScript"],"sub_categories":[],"readme":"# Safe space - Github action\n\nGithub action that uses machine learning to detect potential toxic comments added to PRs and issues so authors can have a chance to edit them and keep repos a safe space.\n\nIt uses the [Tensorflow.js toxicity classification model](https://github.com/tensorflow/tfjs-models/tree/master/toxicity).\n\nIt currently works when comments are posted on issues and PRs, as well as when pull request reviews are submitted.\n\n## Demo\n\n![](demo.gif)\n\nIf you want some details about how it works, feel free to check the [blog post](https://charliegerard.dev/blog/github-action-toxic-comments).\n\n## How to use\n\n_If you do not have any Github actions already set up in your repo, start by creating a .github/workflows folder._\n\nInside your workflows folder, create a new .yml file, for example `main.yml` and copy the following lines:\n\n```yml\non: [issue_comment, pull_request_review]\n\njobs:\n  toxic_check:\n    runs-on: ubuntu-latest\n    name: Safe space\n    steps:\n      - uses: actions/checkout@v2\n      - name: Safe space - action step\n        uses: charliegerard/safe-space@master\n        with:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n`GITHUB_TOKEN` is **required** (note that Github [automatically creates this token](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#:~:text=and%20use%20secrets.-,About%20the%20GITHUB_TOKEN%20secret,authenticate%20in%20a%20workflow%20run.\u0026text=The%20token's%20permissions%20are%20limited,%22Permissions%20for%20the%20GITHUB_TOKEN%20.%22)) but two other parameters are optional:\n\n\n- `message` - a custom message you'd like to display in the automatic comment\n- `toxicity_threshold` - a float number between 0 and 1. It will be used when loading the machine learning model. Its default value is 0.9.\n\n```yml\non: [issue_comment, pull_request_review]\n\njobs:\n  toxic_check:\n    runs-on: ubuntu-latest\n    name: Toxicity check\n    steps:\n      - uses: actions/checkout@v2\n      - name: Safe space - action step\n        uses: charliegerard/safe-space@master\n        with:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          message: \"this is my custom message\"\n          toxicity_threshold: 0.7\n```\n\nThe action can take up to 40s to run so, if you are testing it out in your repository, keep in mind that the bot will not display right after a toxic comment is posted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharliegerard%2Fsafe-space","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharliegerard%2Fsafe-space","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharliegerard%2Fsafe-space/lists"}