ListPushRules

Updated at:

Lists the push rules for a specified repository. This operation does not support pagination.

Operation description

This operation requires repository administrator permissions or higher.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /api/v4/projects/{repositoryId}/push_rule/push_rules/list HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

repositoryId

integer

Yes

The ID of the repository.

889910

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The organization ID. You can find this ID in the URL of your organization's page on the Alibaba Cloud DevOps platform: https://devops.aliyun.com/organization/{organizationId}.

60d54f3daccf2bbd6659f3ad

accessToken

string

No

The personal access token. This parameter is not required if you use an Alibaba Cloud AccessKey pair or a Security Token Service (STS) token for authentication.

f0b1e61db5961df5975a93f9129d2513

Response elements

Element

Type

Description

Example

object

The response schema.

requestId

string

The request ID.

ASSDS-ASSASX-XSAXSA-XSAXSAXS

errorCode

string

The error code.

Openapi.RequestError

errorMessage

string

The error message.

""

success

boolean

Indicates whether the request was successful.

true

total

integer

The total number of results.

2

result

array<object>

The list of results.

array<object>

Details of a push rule.

id

integer

The ID of the push rule.

2077

ruleInfos

array<object>

A list of rule details.

object

Details of a rule checker.

checkerName

string

The name of the rule checker. Valid values include:

  • CommitMessageChecker: The commit message rule.

  • CommitAuthorEmailChecker: The commit author email rule.

  • CommitAuthorChecker: The commit author check.

  • CommitCommitterChecker: The committer check.

  • ForcePushChecker: The force push check.

  • CommitFilesChecker: The committed file restriction rule.

CommitFilesChecker

checkerType

string

Specifies the restriction level. This parameter is valid only for the commit author check and the committer check. It is optional for other rules. Valid values:

  • warn: Issues a warning but allows the push.

  • block: Blocks the push.

warn

extraMessage

string

Provides additional configuration for certain rule checkers:

  • For a commit message rule, this specifies the regular expression for the commit message.

  • For a commit author email rule, this specifies the regular expression for the author's email address.

  • For a force push check, set this value to "disabled".

  • For a commit author check, set this value to "on" to enable the check. Omit this parameter to disable the check.

  • For a committer check, set this value to "on" to enable the check. Omit this parameter to disable the check.

""

fileRuleRegexes

array

This parameter is valid only for the committed file restriction rule. You can provide one or more regular expressions to restrict committed files.

string

A regular expression used to restrict file paths.

\.java$

gmtCreate

string

The time when the rule was created.

2023-09-03T18:20:06+08:00

gmtModified

string

The time when the rule was last updated.

2023-09-03T18:20:06+08:00

Examples

Success response

JSON format

{
  "requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
  "errorCode": "Openapi.RequestError",
  "errorMessage": "\"\"",
  "success": true,
  "total": 2,
  "result": [
    {
      "id": 2077,
      "ruleInfos": [
        {
          "checkerName": "CommitFilesChecker",
          "checkerType": "warn",
          "extraMessage": "\"\"",
          "fileRuleRegexes": [
            "\\.java$"
          ]
        }
      ],
      "gmtCreate": "2023-09-03T18:20:06+08:00",
      "gmtModified": "2023-09-03T18:20:06+08:00"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.