secret-scanning

List repository custom patterns

Lists secret scanning custom patterns for a repository.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

get/repos/{owner}/{repo}/secret-scanning/custom-patterns

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

Query parameters

state'published' | 'unpublished'

Filter custom patterns by state. When absent, returns patterns in all states.

push_protection'enabled' | 'disabled'

Filter custom patterns by whether push protection is enabled. When absent, returns patterns regardless of push protection status.

sort'created' | 'updated' | 'name'

The property to sort the results by.

direction'asc' | 'desc'

The direction to sort the results by.

beforestring

A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."

afterstring

A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."

Response

Response

idinteger required

The ID of the custom pattern.

namestring required

The name of the custom pattern.

patternstring required

The regular expression of the custom pattern.

slugstring required

A URL-friendly identifier for the custom pattern, derived from its name.

state'published' | 'unpublished' required

The state of the custom pattern.

push_protection_enabledboolean required

Whether push protection is enabled for this custom pattern.

start_delimiterstring nullable

The start delimiter regex for the custom pattern.

end_delimiterstring nullable

The end delimiter regex for the custom pattern.

must_matchstring[] nullable

List of regexes that the secret must match.

must_not_matchstring[] nullable

List of regexes that the secret must not match.

custom_pattern_versionstring nullable

The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update.

created_atstring date-time

The date and time the custom pattern was created in ISO 8601 format.

updated_atstring date-time

The date and time the custom pattern was last updated in ISO 8601 format.

Changes

Changed in 3 of the 62 revisions of this API.23

  • 2022-11-282a292eb46bb42See the full diff
    • deleted the query request parameter page

      request-parameter-removed

    • deleted the query request parameter per_page

      request-parameter-removed

  • 2022-11-28cb56473559e72See the full diff
    • added the new optional query request parameter after

      new-optional-request-parameter

    • added the new optional query request parameter before

      new-optional-request-parameter

  • 2022-11-286b7bab78dc341See the full diff
    • endpoint added

      endpoint-added

Of the 62 revisions, 1 has no diff computed.