ドキュメントには頻繁に更新が加えられ、その都度公開されています。本ページの翻訳はまだ未完成な部分があることをご了承ください。最新の情報については、英語のドキュメンテーションをご参照ください。本ページの翻訳に問題がある場合はこちらまでご連絡ください。

このバージョンの GitHub Enterprise はこの日付をもって終了となります: このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2020-08-20. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの改善、新機能のためには、最新バージョンのGitHub Enterpriseにアップグレードしてください。 アップグレードに関する支援については、GitHub Enterprise supportに連絡してください。

記事のバージョン: Enterprise Server 2.18

行動規範

ここには以下の内容があります:

Codes of Conduct API を使用して、リポジトリの行動規範に関する情報を取得できます。 リポジトリの行動規範を取得するには、「Get a repository」エンドポイントを使用します。

get /codes_of_conduct

パラメータ

Name Type In Description
accept string header

This API is under preview and subject to change.

プレビューの通知を見る.

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.scarlet-witch-preview+json" \
  https://{hostname}/codes_of_conduct
JavaScript (@octokit/core.js)
await octokit.request('GET /codes_of_conduct', {
  mediaType: {
    previews: [
      'scarlet-witch'
    ]
  }
})

Default response

Status: 200 OK
[
  {
    "key": "citizen_code_of_conduct",
    "name": "Citizen Code of Conduct",
    "url": "https://api.github.com/codes_of_conduct/citizen_code_of_conduct"
  },
  {
    "key": "contributor_covenant",
    "name": "Contributor Covenant",
    "url": "https://api.github.com/codes_of_conduct/contributor_covenant"
  }
]

Notes

プレビュー通知

The Codes of Conduct API is currently available for developers to preview.

To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.scarlet-witch-preview+json
☝️ このヘッダは必須です.

get /codes_of_conduct/{key}

パラメータ

Name Type In Description
accept string header

This API is under preview and subject to change.

プレビューの通知を見る.
key string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.scarlet-witch-preview+json" \
  https://{hostname}/codes_of_conduct/KEY
JavaScript (@octokit/core.js)
await octokit.request('GET /codes_of_conduct/{key}', {
  key: 'key',
  mediaType: {
    previews: [
      'scarlet-witch'
    ]
  }
})

Default response

Status: 200 OK
{
  "key": "contributor_covenant",
  "name": "Contributor Covenant",
  "url": "https://api.github.com/codes_of_conduct/contributor_covenant",
  "body": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\n                  to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\n                  posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n"
}

Notes

プレビュー通知

The Codes of Conduct API is currently available for developers to preview.

To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.scarlet-witch-preview+json
☝️ このヘッダは必須です.

Get the code of conduct for a repository

This method returns the contents of the repository's code of conduct file, if one is detected.

get /repos/{owner}/{repo}/community/code_of_conduct

パラメータ

Name Type In Description
accept string header

This API is under preview and subject to change.

プレビューの通知を見る.
owner string path
repo string path

コードサンプル

Shell
curl \
  -H "Accept: application/vnd.github.scarlet-witch-preview+json" \
  https://{hostname}/repos/octocat/hello-world/community/code_of_conduct
JavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/community/code_of_conduct', {
  owner: 'octocat',
  repo: 'hello-world',
  mediaType: {
    previews: [
      'scarlet-witch'
    ]
  }
})

Default response

Status: 200 OK
{
  "key": "contributor_covenant",
  "name": "Contributor Covenant",
  "url": "https://github.com/LindseyB/cosee/blob/master/CODE_OF_CONDUCT.md",
  "body": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include=>\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include=>\n\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\nto any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\nposting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lindseyb@github.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n"
}

Notes

プレビュー通知

The Codes of Conduct API is currently available for developers to preview.

To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.scarlet-witch-preview+json
☝️ このヘッダは必須です.

担当者にお尋ねください

探しているものが見つからなかったでしょうか?

弊社にお問い合わせください