The challenge of managing online communities is continuously growing. Often times the members are spread across multiple platforms, making it harder to get a complete snapshot of its members' interactions and behavior. While platforms employ different tools and methods to moderate (potentially harmful) conversations, the moderators' priority will always be to create a safe and positive community experience for everybody. This Action aims to help just a little bit the GitHub communities moderators into enforcing their Code of Conduct.
This is a simple GitHub Action that notifies the members of the community of their Code of Conduct document when this is mentioned. The Action will reply to issues and pull requests comments when the keywords code of conduct are mentioned.
Default: "For questions about our community guidelines, please refer to our Code of Conduct: <URL>."
The comment that the bot will post about the Code of Conduct. It can use the tag <URL>
to be replaced with the Code of Conduct URL mentioned in the coc-url
input. It supports multiline and markdown formatting, see Workflows for examples.
Default: "CODE_OF_CONDUCT.md"
The URL to the Code of Conduct. Used to be mentioned in the body of the comment, where the tag <URL>
is placed. It supports both relative paths (e.g. /docs/CODE_OF_CONDUCT.md
) and absolute paths (e.g. https://example.com/codeofconduct.html
), see Workflows for examples.
For all the use cases, I strongly recommend using the if: contains(github.event.comment.body, 'code of conduct')
conditional for the job. It will skip the processing (15s per comment) of the comment altogether if it does not contain the keywords code of conduct. The conditional is not case sensitive, it can mention Code of Conduct or other case-y variations.
name: CoC Notifier
on:
issue_comment: # Action gets triggered on both issues and PRs comments
types:
- created
jobs:
notify:
name: "Code of Conduct Notifier"
runs-on: ubuntu-latest
if: contains(github.event.comment.body, 'code of conduct')
steps:
- uses: BogDAAAMN/code-of-conduct-notifier-action@v1.0.0
name: CoC Notifier
on:
issue_comment: # Action gets triggered on both issues and PRs comments
types:
- created
jobs:
notify:
name: "Code of Conduct Notifier"
runs-on: ubuntu-latest
if: contains(github.event.comment.body, 'code of conduct')
steps:
- uses: BogDAAAMN/code-of-conduct-notifier-action@v1.0.0
with:
comment-body: "For questions about our **community guidelines**, please refer to our [Code of Conduct](<URL>)."
name: CoC Notifier
on:
issue_comment: # Action gets triggered on both issues and PRs comments
types:
- created
jobs:
notify:
name: "Code of Conduct Notifier"
runs-on: ubuntu-latest
if: contains(github.event.comment.body, 'code of conduct')
steps:
- uses: BogDAAAMN/code-of-conduct-notifier-action@v1.0.0
with:
comment-body: |
For questions about our **community guidelines**, please refer to our [Code of Conduct](<URL>).
As always, our moderator team is happy to answer questions or provide more detail.
name: CoC Notifier
on:
issue_comment: # Action gets triggered on both issues and PRs comments
types:
- created
jobs:
notify:
name: "Code of Conduct Notifier"
runs-on: ubuntu-latest
if: contains(github.event.comment.body, 'code of conduct')
steps:
- uses: BogDAAAMN/code-of-conduct-notifier-action@v1.0.0
with:
coc-url: https://example.com/code-of-conduct.html
comment-body: |
For questions about our **community guidelines**, please refer to our [Code of Conduct](<URL>).
As always, our moderator team is happy to answer questions or provide more detail.
name: CoC Notifier
on:
issue_comment: # Action gets triggered on both issues and PRs comments
types:
- created
jobs:
notify:
name: "Code of Conduct Notifier"
runs-on: ubuntu-latest
if: contains(github.event.comment.body, 'code of conduct')
steps:
- uses: BogDAAAMN/code-of-conduct-notifier-action@v1.0.0
with:
coc-url: /docs/CODE_OF_CONDUCT.md
comment-body: "For questions about our **community guidelines**, please refer to our [Code of Conduct](<URL>)."
The information presented in the description of the action, the inspiration, and the default messages used by the action are shaped from the following sources:
- Constellation Report: State of Community Tools 2021 by Orbit
- Mozilla Community Participation Guidelines by Mozilla Corporation
- Feedback and conversations with Virtual Coffee friends