├── .github ├── CODEOWNERS ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── linter.yml │ └── git-commit-data-action.yml ├── .editorconfig ├── SECURITY.md ├── DEVELOPER.md ├── LICENSE ├── CONTRIBUTING.md ├── README.md ├── action.yml ├── tests └── git_log_format.bats ├── git-commit-data.sh └── CODE_OF_CONDUCT.md /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @rlespinasse 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: rlespinasse 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: 'github-actions' 4 | directory: '/' 5 | schedule: 6 | interval: 'weekly' 7 | groups: 8 | dependencies: 9 | patterns: 10 | - '*' 11 | labels: [] 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions and Branches 4 | 5 | | Version | Branch | Supported | 6 | |---------|--------|--------------------| 7 | | 1.x | v1.x | :white_check_mark: | 8 | 9 | A GitHub repository can used one of the available branches as action inside its workflows. 10 | 11 | ## Reporting a Vulnerability 12 | 13 | You can report a Vulnerability by [my email](mailto:romain.lespinasse@gmail.com). 14 | 15 | _Vulnerability stages :_ 16 | 17 | - Reported, 18 | - Confirmed (or declined), 19 | - Fixed on maintained version series. 20 | 21 | After a vulnerability fix, an GitHub issue will be created as document this vulnerability. 22 | -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Lint Code Base 3 | 4 | on: pull_request 5 | 6 | permissions: read-all 7 | 8 | jobs: 9 | build: 10 | name: Lint Code Base 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: read 14 | packages: read 15 | statuses: write 16 | steps: 17 | - name: Checkout Code 18 | uses: actions/checkout@v6 19 | with: 20 | # Full git history is needed to get a proper 21 | # list of changed files within `super-linter` 22 | fetch-depth: 0 23 | 24 | - name: Lint Code Base 25 | uses: super-linter/super-linter@v8 26 | env: 27 | VALIDATE_ALL_CODEBASE: false 28 | VALIDATE_YAML_PRETTIER: false 29 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 30 | -------------------------------------------------------------------------------- /DEVELOPER.md: -------------------------------------------------------------------------------- 1 | # Developer guide 2 | 3 | ## Add a missing data 4 | 5 | 1. Compose your missing data based of [git log pretty formats][1], 6 | 2. Choose a environment variable name linked to this missing data using the prefix `GIT_COMMIT_`, 7 | 3. Update the `entrypoint.sh` to generate the environment variable content, 8 | * Adding template format using naming convention `TEMPLATE_COMMIT_` prefix and `_FORMAT` suffix, 9 | * Use `git_log_format` method to generate the content of your new environment variable. 10 | 4. Update the `tests/git_log_format.bats` to validate your new environment variable generation, 11 | 5. Run `npm test` to validate your new tests, 12 | 6. Update the `README.md` file to document your new environment variable, 13 | 7. Create a new Pull-request to be reviewed. 14 | 15 | [1]: https://git-scm.com/docs/pretty-formats 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Romain Lespinasse 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute to GitHub Slug Action 2 | 3 | ## Did you find a bug 4 | 5 | * **Ensure the bug was not already reported** by searching on GitHub under [Issues][1]. 6 | 7 | * If you're unable to find an open issue addressing the problem, [open an issue][2]. 8 | Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. 9 | 10 | ## Did you write a patch that fixes a bug 11 | 12 | * Open a new GitHub pull request with the patch. 13 | 14 | * Ensure the PR description clearly describes the problem and solution. 15 | Include the relevant issue number if applicable. 16 | 17 | ## Do you intend to add a new feature or change an existing one 18 | 19 | * Suggest your change by [opening an issue][2] and start writing code. 20 | 21 | ## Do you have questions about the source code 22 | 23 | * [open an issue][2] with your question. 24 | 25 | Thanks! 26 | 27 | [1]: https://github.com/rlespinasse/git-commit-data-action/issues 28 | [2]: https://github.com/rlespinasse/git-commit-data-action/issues/new 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git commit data action 2 | 3 | This action exposes git commit data. 4 | 5 | - **GIT_COMMIT_SHA** expose `commit hash` 6 | - **GIT_COMMIT_SHORT_SHA** expose `abbreviated commit hash` 7 | - **GIT_COMMIT_AUTHOR** expose `Author name ` 8 | - **GIT_COMMIT_AUTHOR_NAME** expose `Author name` 9 | - **GIT_COMMIT_AUTHOR_EMAIL** expose `author@email.tld` 10 | - **GIT_COMMIT_COMMITTER** expose `Committer name ` 11 | - **GIT_COMMIT_COMMITTER_NAME** expose `Committer name` 12 | - **GIT_COMMIT_COMMITTER_EMAIL** expose `committer@email.tld` 13 | - **GIT_COMMIT_MESSAGE_SUBJECT** expose `The first line of the commit message` 14 | - **GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED** expose `the-first-line-of-the-commit-message-in-sanitized-way` 15 | - **GIT_COMMIT_MESSAGE_BODY** expose `The body of the commit message` 16 | 17 | ## Exposed environment variables 18 | 19 | ```yaml 20 | - name: Expose git commit data 21 | uses: rlespinasse/git-commit-data-action@v1 22 | 23 | - name: Print git commit data 24 | run: | 25 | echo "Get commit info" 26 | echo " - ${{ env.GIT_COMMIT_SHA }}" 27 | echo " - ${{ env.GIT_COMMIT_SHORT_SHA }}" 28 | echo "Get author info" 29 | echo " - ${{ env.GIT_COMMIT_AUTHOR }}" 30 | echo " - ${{ env.GIT_COMMIT_AUTHOR_NAME }}" 31 | echo " - ${{ env.GIT_COMMIT_AUTHOR_EMAIL }}" 32 | echo "Get committer info" 33 | echo " - ${{ env.GIT_COMMIT_COMMITTER }}" 34 | echo " - ${{ env.GIT_COMMIT_COMMITTER_NAME }}" 35 | echo " - ${{ env.GIT_COMMIT_COMMITTER_EMAIL }}" 36 | echo "Get message info" 37 | echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}" 38 | echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED }}" 39 | echo " - ${{ env.GIT_COMMIT_MESSAGE_BODY }}" 40 | ``` 41 | 42 | ## Need other commit data 43 | 44 | Feel free to contribute. Check out the [developer guide](DEVELOPER.md) 45 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | # action.yml 2 | name: "Git Commit Data" 3 | description: "Action to expose git commit data (author, committer, message, ...)" 4 | author: "Romain Lespinasse" 5 | branding: 6 | icon: "settings" 7 | color: "gray-dark" 8 | inputs: 9 | publish-env: 10 | description: "Publish slugs as environment variables" 11 | default: "true" 12 | required: true 13 | outputs: 14 | sha: 15 | description: "commit hash" 16 | value: ${{ steps.commit-data.outputs.sha }} 17 | short-sha: 18 | description: "abbreviated commit hash" 19 | value: ${{ steps.commit-data.outputs.short-sha }} 20 | author: 21 | description: "Author name " 22 | value: ${{ steps.commit-data.outputs.author }} 23 | author-name: 24 | description: "Author name" 25 | value: ${{ steps.commit-data.outputs.author-name }} 26 | author-email: 27 | description: "author@email.tld" 28 | value: ${{ steps.commit-data.outputs.author-email }} 29 | committer: 30 | description: "Committer name " 31 | value: ${{ steps.commit-data.outputs.committer }} 32 | committer-name: 33 | description: "Committer name" 34 | value: ${{ steps.commit-data.outputs.committer-name }} 35 | committer-email: 36 | description: "committer@email.tld" 37 | value: ${{ steps.commit-data.outputs.committer-email }} 38 | message-subject: 39 | description: "The first line of the commit message" 40 | value: ${{ steps.commit-data.outputs.message-subject }} 41 | message-subject-sanitized: 42 | description: "the-first-line-of-the-commit-message-in-sanitized-way" 43 | value: ${{ steps.commit-data.outputs.message-subject-sanitized }} 44 | message-body: 45 | description: "The body of the commit message" 46 | value: ${{ steps.commit-data.outputs.message-body }} 47 | runs: 48 | using: "composite" 49 | steps: 50 | - id: commit-data 51 | run: $GITHUB_ACTION_PATH/git-commit-data.sh 52 | shell: bash 53 | env: 54 | INPUT_PUBLISH_ENV: ${{ inputs.publish-env }} 55 | -------------------------------------------------------------------------------- /.github/workflows/git-commit-data-action.yml: -------------------------------------------------------------------------------- 1 | name: git-commit-data-action 2 | on: 3 | pull_request: 4 | push: 5 | branches: 6 | - v1.x 7 | permissions: read-all 8 | jobs: 9 | script-testing: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v6 13 | with: 14 | # Need to download all history in order 15 | # to make the tests work properly 16 | fetch-depth: 0 17 | - uses: docker://ffurrer/bats:latest 18 | with: 19 | args: "--recursive ." 20 | 21 | os-testing: 22 | runs-on: ${{ matrix.os }} 23 | strategy: 24 | matrix: 25 | os: 26 | - ubuntu-latest 27 | - macos-latest 28 | - windows-latest 29 | steps: 30 | - uses: actions/checkout@v6 31 | - uses: ./ 32 | - name: Output 33 | run: | 34 | echo "Get commit info" 35 | echo " - ${{ env.GIT_COMMIT_SHA }}" 36 | echo " - ${{ env.GIT_COMMIT_SHORT_SHA }}" 37 | echo "Get author info" 38 | echo " - ${{ env.GIT_COMMIT_AUTHOR }}" 39 | echo " - ${{ env.GIT_COMMIT_AUTHOR_NAME }}" 40 | echo " - ${{ env.GIT_COMMIT_AUTHOR_EMAIL }}" 41 | echo "Get committer info" 42 | echo " - ${{ env.GIT_COMMIT_COMMITTER }}" 43 | echo " - ${{ env.GIT_COMMIT_COMMITTER_NAME }}" 44 | echo " - ${{ env.GIT_COMMIT_COMMITTER_EMAIL }}" 45 | echo "Get message info" 46 | echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}" 47 | echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED }}" 48 | echo " - ${{ env.GIT_COMMIT_MESSAGE_BODY }}" 49 | 50 | release: 51 | runs-on: ubuntu-latest 52 | needs: 53 | - script-testing 54 | - os-testing 55 | permissions: 56 | contents: write 57 | issues: write 58 | id-token: write 59 | packages: write 60 | concurrency: 61 | group: release-${{ github.ref }} 62 | steps: 63 | - uses: actions/checkout@v6 64 | with: 65 | persist-credentials: false 66 | 67 | - name: Release That 68 | uses: rlespinasse/release-that@v1 69 | with: 70 | github-token: ${{ secrets.GH_TOKEN }} 71 | -------------------------------------------------------------------------------- /tests/git_log_format.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | # Prepare git 4 | apk add --no-cache git >/dev/null 5 | git config --global --add safe.directory '*' 6 | 7 | TEST_COMMIT_SHA=f554bec660038601b8882c1e0cc5d0d8fcebf221 8 | 9 | # Load git_log_format function 10 | source git-commit-data.sh >/dev/null 2>&1 11 | 12 | @test "git_log_format: sha" { 13 | test_git_log_format "$TEMPLATE_SHA_FORMAT" "f554bec660038601b8882c1e0cc5d0d8fcebf221" 14 | } 15 | 16 | @test "git_log_format: short sha" { 17 | test_git_log_format "$TEMPLATE_SHORT_SHA_FORMAT" "f554bec" 18 | } 19 | 20 | @test "git_log_format: author" { 21 | test_git_log_format "$TEMPLATE_AUTHOR_FORMAT" "rlespinasse " 22 | } 23 | 24 | @test "git_log_format: author name" { 25 | test_git_log_format "$TEMPLATE_AUTHOR_NAME_FORMAT" "rlespinasse" 26 | } 27 | 28 | @test "git_log_format: author email" { 29 | test_git_log_format "$TEMPLATE_AUTHOR_EMAIL_FORMAT" "romain.lespinasse@gmail.com" 30 | } 31 | 32 | @test "git_log_format: committer" { 33 | test_git_log_format "$TEMPLATE_COMMITTER_FORMAT" "rlespinasse " 34 | } 35 | 36 | @test "git_log_format: committer name" { 37 | test_git_log_format "$TEMPLATE_COMMITTER_NAME_FORMAT" "rlespinasse" 38 | } 39 | 40 | @test "git_log_format: committer email" { 41 | test_git_log_format "$TEMPLATE_COMMITTER_EMAIL_FORMAT" "romain.lespinasse@gmail.com" 42 | } 43 | 44 | @test "git_log_format: message subject" { 45 | test_git_log_format "$TEMPLATE_COMMIT_MESSAGE_SUBJECT_FORMAT" "ci: create a commit with multiple lines" 46 | } 47 | 48 | @test "git_log_format: message subject sanitized" { 49 | test_git_log_format "$TEMPLATE_COMMIT_MESSAGE_SUBJECT_SANITIZED_FORMAT" "ci-create-a-commit-with-multiple-lines" 50 | } 51 | 52 | @test "git_log_format: message body" { 53 | BODY=$( 54 | cat <<-END 55 | Line 1 56 | Line 2 57 | Line 3 58 | Line 4 59 | 60 | Bottom line 61 | END 62 | ) 63 | test_git_log_format "$TEMPLATE_COMMIT_MESSAGE_BODY_FORMAT" "$BODY" 64 | } 65 | 66 | test_git_log_format() { 67 | given="${1}" 68 | expected="${2}" 69 | 70 | actual="$(git_log_format "${given}" "$TEST_COMMIT_SHA")" 71 | echo "expected : [${expected}], actual : [${actual}]" 72 | [ "${actual}" == "${expected}" ] 73 | } 74 | -------------------------------------------------------------------------------- /git-commit-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TEMPLATE_SHA_FORMAT="%H" 4 | TEMPLATE_SHORT_SHA_FORMAT="%h" 5 | 6 | TEMPLATE_AUTHOR_FORMAT="%an <%ae>" 7 | TEMPLATE_AUTHOR_NAME_FORMAT="%an" 8 | TEMPLATE_AUTHOR_EMAIL_FORMAT="%ae" 9 | 10 | TEMPLATE_COMMITTER_FORMAT="%cn <%ce>" 11 | TEMPLATE_COMMITTER_NAME_FORMAT="%cn" 12 | TEMPLATE_COMMITTER_EMAIL_FORMAT="%ce" 13 | 14 | TEMPLATE_COMMIT_MESSAGE_SUBJECT_FORMAT="%s" 15 | TEMPLATE_COMMIT_MESSAGE_SUBJECT_SANITIZED_FORMAT="%f" 16 | TEMPLATE_COMMIT_MESSAGE_BODY_FORMAT="%b" 17 | 18 | git_log_format() { 19 | pattern="$1" 20 | reference="$2" 21 | git log -1 --pretty=format:"$pattern" "$reference" 22 | } 23 | 24 | COMMIT_SHA=$(git_log_format "${TEMPLATE_SHA_FORMAT}" "HEAD") 25 | COMMIT_SHORT_SHA=$(git_log_format "${TEMPLATE_SHORT_SHA_FORMAT}" "HEAD") 26 | COMMIT_AUTHOR=$(git_log_format "${TEMPLATE_AUTHOR_FORMAT}" "HEAD") 27 | COMMIT_AUTHOR_NAME=$(git_log_format "${TEMPLATE_AUTHOR_NAME_FORMAT}" "HEAD") 28 | COMMIT_AUTHOR_EMAIL=$(git_log_format "${TEMPLATE_AUTHOR_EMAIL_FORMAT}" "HEAD") 29 | COMMIT_COMMITTER=$(git_log_format "${TEMPLATE_COMMITTER_FORMAT}" "HEAD") 30 | COMMIT_COMMITTER_NAME=$(git_log_format "${TEMPLATE_COMMITTER_NAME_FORMAT}" "HEAD") 31 | COMMIT_COMMITTER_EMAIL=$(git_log_format "${TEMPLATE_COMMITTER_EMAIL_FORMAT}" "HEAD") 32 | COMMIT_MESSAGE_SUBJECT=$(git_log_format "${TEMPLATE_COMMIT_MESSAGE_SUBJECT_FORMAT}" "HEAD") 33 | COMMIT_MESSAGE_SUBJECT_SANITIZED=$(git_log_format "${TEMPLATE_COMMIT_MESSAGE_SUBJECT_SANITIZED_FORMAT}" "HEAD") 34 | COMMIT_MESSAGE_BODY=$(git_log_format "${TEMPLATE_COMMIT_MESSAGE_BODY_FORMAT}" "HEAD") 35 | 36 | echo "GIT_COMMIT_SHA=${COMMIT_SHA}" 37 | echo "GIT_COMMIT_SHORT_SHA=${COMMIT_SHORT_SHA}" 38 | echo "GIT_COMMIT_AUTHOR=${COMMIT_AUTHOR}" 39 | echo "GIT_COMMIT_AUTHOR_NAME=${COMMIT_AUTHOR_NAME}" 40 | echo "GIT_COMMIT_AUTHOR_EMAIL=${COMMIT_AUTHOR_EMAIL}" 41 | echo "GIT_COMMIT_COMMITTER=${COMMIT_COMMITTER}" 42 | echo "GIT_COMMIT_COMMITTER_NAME=${COMMIT_COMMITTER_NAME}" 43 | echo "GIT_COMMIT_COMMITTER_EMAIL=${COMMIT_COMMITTER_EMAIL}" 44 | echo "GIT_COMMIT_MESSAGE_SUBJECT=${COMMIT_MESSAGE_SUBJECT}" 45 | echo "GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED=${COMMIT_MESSAGE_SUBJECT_SANITIZED}" 46 | echo 'GIT_COMMIT_MESSAGE_BODY<> "$GITHUB_OUTPUT" 67 | else 68 | echo "::set-output name=sha::${COMMIT_SHA}" 69 | echo "::set-output name=short-sha::${COMMIT_SHORT_SHA}" 70 | echo "::set-output name=author::${COMMIT_AUTHOR}" 71 | echo "::set-output name=author-name::${COMMIT_AUTHOR_NAME}" 72 | echo "::set-output name=author-email::${COMMIT_AUTHOR_EMAIL}" 73 | echo "::set-output name=committer::${COMMIT_COMMITTER}" 74 | echo "::set-output name=committer_NAME::${COMMIT_COMMITTER_NAME}" 75 | echo "::set-output name=committer_EMAIL::${COMMIT_COMMITTER_EMAIL}" 76 | echo "::set-output name=message-subject::${COMMIT_MESSAGE_SUBJECT}" 77 | echo "::set-output name=message-subject-sanitized::${COMMIT_MESSAGE_SUBJECT_SANITIZED}" 78 | fi 79 | 80 | if [ "${INPUT_PUBLISH_ENV}" == "true" ]; then 81 | { 82 | echo "GIT_COMMIT_SHA=${COMMIT_SHA}" 83 | echo "GIT_COMMIT_SHORT_SHA=${COMMIT_SHORT_SHA}" 84 | echo "GIT_COMMIT_AUTHOR=${COMMIT_AUTHOR}" 85 | echo "GIT_COMMIT_AUTHOR_NAME=${COMMIT_AUTHOR_NAME}" 86 | echo "GIT_COMMIT_AUTHOR_EMAIL=${COMMIT_AUTHOR_EMAIL}" 87 | echo "GIT_COMMIT_COMMITTER=${COMMIT_COMMITTER}" 88 | echo "GIT_COMMIT_COMMITTER_NAME=${COMMIT_COMMITTER_NAME}" 89 | echo "GIT_COMMIT_COMMITTER_EMAIL=${COMMIT_COMMITTER_EMAIL}" 90 | echo "GIT_COMMIT_MESSAGE_SUBJECT=${COMMIT_MESSAGE_SUBJECT}" 91 | echo "GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED=${COMMIT_MESSAGE_SUBJECT_SANITIZED}" 92 | echo 'GIT_COMMIT_MESSAGE_BODY<>"$GITHUB_ENV" 96 | fi 97 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, caste, color, religion, or sexual 10 | identity and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the overall 26 | community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or advances of 31 | any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email address, 35 | without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official email address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | . 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series of 86 | actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or permanent 93 | ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within the 113 | community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.1, available at 119 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 120 | 121 | Community Impact Guidelines were inspired by 122 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 123 | 124 | For answers to common questions about this code of conduct, see the FAQ at 125 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 126 | [https://www.contributor-covenant.org/translations][translations]. 127 | 128 | [homepage]: https://www.contributor-covenant.org 129 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 130 | [Mozilla CoC]: https://github.com/mozilla/diversity 131 | [FAQ]: https://www.contributor-covenant.org/faq 132 | [translations]: https://www.contributor-covenant.org/translations 133 | --------------------------------------------------------------------------------