Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pilot-automated-actions/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ description: >-
---

# Reference

171 changes: 116 additions & 55 deletions pilot-automated-actions/reference/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
guide.
---

# GitHub
# Pilot Actions for GitHub

## `github.add_comment`

Expand All @@ -17,14 +17,18 @@ Add a comment to an issue or pull request.

### Inputs

This action action expects either a single string argument or an object argument with the following properties:
This action expects either a single string argument or an object argument with
the following properties:

* `target` (`string | null`)
* The target issue or pull request to apply the label to.
- `target` (`string | null`)

This must be provided unless used where the target is implicitly defined by its context.
* `body` (`string`)
* The contents of the comment.
- The target issue or pull request to apply the label to.

This must be provided unless used where the target is implicitly defined by
its context.

- `body` (`string`)
- The contents of the comment.

## `github.add_label`

Expand All @@ -34,18 +38,23 @@ This action action expects either a single string argument or an object argument

Add a label to an issue or pull request.

If given as a string, the string is interpreted as the label to apply and the target is implicitly determined by the calling context.
If given as a string, the string is interpreted as the label to apply and the
target is implicitly determined by the calling context.

### Inputs

This action action expects either a single string argument or an object argument with the following properties:
This action expects either a single string argument or an object argument with
the following properties:

- `target` (`string | null`)

- The target issue or pull request to apply the label to.

* `target` (`string | null`)
* The target issue or pull request to apply the label to.
This must be provided unless used where the target is implicitly defined by
its context.

This must be provided unless used where the target is implicitly defined by its context.
* `label` (`string`)
* The label to apply to the issue or pull request.
- `label` (`string`)
- The label to apply to the issue or pull request.

## `github.add_reviewer`

Expand All @@ -55,24 +64,32 @@ This action action expects either a single string argument or an object argument

Add a reviewer to a pull request.

If given as a string, the string is interpreted as either a GitHub login or a GitHub team (in the form `@org/team`) and the target is implicitly determined by the calling context.
If given as a string, the string is interpreted as either a GitHub login or a
GitHub team (in the form `@org/team`) and the target is implicitly determined by
the calling context.

### Inputs

This action action expects either a single string argument or an object argument with the following properties:
This action expects either a single string argument or an object argument with
the following properties:

- `target` (`string | null`)

- The target issue or pull request to apply the label to.

This must be provided unless used where the target is implicitly defined by
its context.

* `target` (`string | null`)
* The target issue or pull request to apply the label to.
- `github_login` (`string | null`)

This must be provided unless used where the target is implicitly defined by its context.
* `github_login` (`string | null`)
* The GitHub login (username) to be assigned as a reviewer.
- The GitHub login (username) to be assigned as a reviewer.

Exactly one of `github_login` and `github_team` must be specified.
* `github_team` (`string | null`)
* The GitHub team (in the form `@org/team`) to be assigned as a reviewer.
Exactly one of `github_login` and `github_team` must be specified.

Exactly one of `github_login` and `github_team` must be specified.
- `github_team` (`string | null`)
- The GitHub team (in the form `@org/team`) to be assigned as a reviewer.

Exactly one of `github_login` and `github_team` must be specified.

## `github.compare_commits`

Expand All @@ -84,31 +101,67 @@ Compare two commits.

### Inputs

This action action expects either a single string argument or an object argument with the following properties:
This action expects either a single string argument or an object argument with
the following properties:

- `owner` (`string | null`)
- `repo` (`string | null`)
- `base` (`string`)

- The base ref to compare against. It can be a branch name, tag name, or a
commit SHA.

* `owner` (`string | null`)
* `repo` (`string | null`)
* `base` (`string`)
* The base ref to compare against. It can be a branch name, tag name, or a commit SHA.
* `head` (`string`)
* The head ref to compare against. It can be a branch name, tag name, or a commit SHA.
- `head` (`string`)
- The head ref to compare against. It can be a branch name, tag name, or a
commit SHA.

### Output

Returns an object with the following properties:

* `ahead_by` (`integer`)
* `base_commit` (`{comments_url: string, commit: {author: {name: string, email: string, date: string} | null, comment_count: integer, committer: {name: string, email: string, date: string} | null, message: string, tree: {sha: string, url: string} , url: string, verification: {verified: boolean, reason: string, signature: string | null, payload: string | null} | null} | null}` )
* `behind_by` (`integer`)
* `commits` (`Array<{comments_url: string, commit: {author: {name: string, email: string, date: string} | null, comment_count: integer, committer: {name: string, email: string, date: string} | null, message: string, tree: {sha: string, url: string} , url: string, verification: {verified: boolean, reason: string, signature: string | null, payload: string | null} | null} | null} >`)
* `diff_url` (`string`)
* `files` (`Array<{additions: integer, blob_url: string, changes: integer, contents_url: string, deletions: integer, filename: string, patch: string | null, previous_filename: string | null, raw_url: string, sha: string, status: 'added' | 'removed' | 'modified' | 'renamed' | 'copied' | 'unchanged'} >`)
* `merge_base_commit` (`{comments_url: string, commit: {author: {name: string, email: string, date: string} | null, comment_count: integer, committer: {name: string, email: string, date: string} | null, message: string, tree: {sha: string, url: string} , url: string, verification: {verified: boolean, reason: string, signature: string | null, payload: string | null} | null} | null}` )
* `patch_url` (`string`)
* `permalink_url` (`string`)
* `status` (`'diverged' | 'ahead' | 'behind' | 'identical'`)
* `total_commits` (`integer`)
* `url` (`string`)
- `ahead_by` (`integer`)
- `base_commit`
(`{comments_url: string, commit: {author: {name: string, email: string, date: string} | null, comment_count: integer, committer: {name: string, email: string, date: string} | null, message: string, tree: {sha: string, url: string} , url: string, verification: {verified: boolean, reason: string, signature: string | null, payload: string | null} | null} | null} `)
- `behind_by` (`integer`)
- `commits`
(`Array<{comments_url: string, commit: {author: {name: string, email: string, date: string} | null, comment_count: integer, committer: {name: string, email: string, date: string} | null, message: string, tree: {sha: string, url: string} , url: string, verification: {verified: boolean, reason: string, signature: string | null, payload: string | null} | null} | null} >`)
- `diff_url` (`string`)
- `files`
(`Array<{additions: integer, blob_url: string, changes: integer, contents_url: string, deletions: integer, filename: string, patch: string | null, previous_filename: string | null, raw_url: string, sha: string, status: 'added' | 'removed' | 'modified' | 'renamed' | 'copied' | 'unchanged'} >`)
- `merge_base_commit`
(`{comments_url: string, commit: {author: {name: string, email: string, date: string} | null, comment_count: integer, committer: {name: string, email: string, date: string} | null, message: string, tree: {sha: string, url: string} , url: string, verification: {verified: boolean, reason: string, signature: string | null, payload: string | null} | null} | null} `)
- `patch_url` (`string`)
- `permalink_url` (`string`)
- `status` (`'diverged' | 'ahead' | 'behind' | 'identical'`)
- `total_commits` (`integer`)
- `url` (`string`)

## `github.remove_label`

**Using YAML actions:** `github.remove_label`

**Using Pilot JavaScript:** `$github.removeLabel(...)`

Remove a label to an issue or pull request.

If given as a string, the string is interpreted as the label to remove and the
target is implicitly determined by the calling context. If the given label is
not present, this action is a no-op.

### Inputs

This action expects either a single string argument or an object argument with
the following properties:

- `target` (`string | null`)

- The target issue or pull request to remove the label from.

This must be provided unless used where the target is implicitly defined by
its context.

- `label` (`string`)
- The label to remove from the issue or pull request.

## `github.user_matches`

Expand All @@ -118,24 +171,32 @@ Returns an object with the following properties:

Determine if a GitHub user matches a given user or team.

If given as a string, the string is interpreted as either a GitHub login or a GitHub team (in the form `@org/team`).
If given as a string, the string is interpreted as either a GitHub login or a
GitHub team (in the form `@org/team`).

### Inputs

This action action expects either a single string argument or an object argument with the following properties:
This action expects either a single string argument or an object argument with
the following properties:

- `target` (`string | null`)

- The GitHub user to match against.

This must be provided unless used where the target is implicitly defined by
its context.

- `github_login` (`string | null`)

* `target` (`string | null`)
* The GitHub user to match against.
- The GitHub login (username) that the target user must match.

This must be provided unless used where the target is implicitly defined by its context.
* `github_login` (`string | null`)
* The GitHub login (username) that the target user must match.
Exactly one of `github_login` and `github_team` must be specified.

Exactly one of `github_login` and `github_team` must be specified.
* `github_team` (`string | null`)
* The GitHub team (in the form `@org/team`) that the target user must be a member of.
- `github_team` (`string | null`)
- The GitHub team (in the form `@org/team`) that the target user must be a
member of.

Exactly one of `github_login` and `github_team` must be specified.
Exactly one of `github_login` and `github_team` must be specified.

### Output

Expand Down
Loading