commit_signature_protection
Creates, updates, deletes, gets or lists a commit_signature_protection resource.
Overview
| Name | commit_signature_protection |
| Type | Resource |
| Id | github.repos.commit_signature_protection |
Fields
The following fields are returned by SELECT queries:
- get_commit_signature_protection
Response
| Name | Datatype | Description |
|---|---|---|
enabled | boolean | |
url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_commit_signature_protection | select | owner, repo, branch | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of true indicates you must sign commits on this branch. For more information, see Signing commits with GPG in GitHub Help.> [!NOTE] > You must enable branch protection to require signed commits. | |
create_commit_signature_protection | insert | owner, repo, branch | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. | |
delete_commit_signature_protection | delete | owner, repo, branch | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
branch | string | The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use the GraphQL API. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_commit_signature_protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of true indicates you must sign commits on this branch. For more information, see Signing commits with GPG in GitHub Help.
> [!NOTE]
> You must enable branch protection to require signed commits.
SELECT
enabled,
url
FROM github.repos.commit_signature_protection
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND branch = '{{ branch }}' -- required
;
INSERT examples
- create_commit_signature_protection
- Manifest
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.
INSERT INTO github.repos.commit_signature_protection (
owner,
repo,
branch
)
SELECT
'{{ owner }}',
'{{ repo }}',
'{{ branch }}'
RETURNING
enabled,
url
;
# Description fields are for documentation purposes
- name: commit_signature_protection
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the commit_signature_protection resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the commit_signature_protection resource.
- name: branch
value: "{{ branch }}"
description: Required parameter for the commit_signature_protection resource.
DELETE examples
- delete_commit_signature_protection
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.
DELETE FROM github.repos.commit_signature_protection
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND branch = '{{ branch }}' --required
;