SDK reference
Pull requests
GET/
Inline review comments with their file and line, approvals, and how many approvals the pull request still needs.
Parameters and answerscurl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/review' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Adds a review comment: a new thread on a line of the diff (path, line, side), or a reply (inReplyTo).
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/review/comments' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"body": "example"
}'POST/
Approves the pull request's current revision, or withdraws your approval. Authors can't approve their own.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/approval' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"approve": true
}'POST/
CodeCommit can't reopen a closed pull request; a new one replaces it under the same number.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/reopen' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
Lists pull requests in one state, newest first. Listing open pull requests also settles any that were merged or closed outside the portal.
Parameters and answerscurl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Opens a pull request that merges source into target.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"title": "Example",
"source": "example",
"target": "example"
}'GET/
A pull request with its commit range, the merge strategies available now, its comments, and codeowners: the owners each changed path needs an approval from (null without a CODEOWNERS file).
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"PATCH/
Changes a pull request's title, description, labels or assignees.
Parameters and answerscurl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"title": "Example",
"description": "example",
"labels": [
"example"
]
}'GET/
Commits the pull request adds to its target.
Parameters and answerscurl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/commits' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
Changed files with unified diffs.
Parameters and answerscurl 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/files' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Merges the pull request. Pass sourceCommitId (the head you reviewed) to fail if the branch has moved since. Into a ruled branch it needs the rule's approvals and code owner reviews (409 otherwise) and a clean secret scan (422); bypass: true merges without the reviews for people on the bypass list, audited.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/merge' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"strategy": "squash"
}'POST/
Closes the pull request without merging.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/close' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Adds a comment to a pull request.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/repos/{name}/pulls/{number}/comments' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"body": "example"
}'