A composite action that gets a pull request on Github.
Requires the pull-requests: read
permission to work.
Name | Description | Default |
---|---|---|
github-token |
The default token to use for this Git operation. If unspecified, this will default to github.token . |
"${{ github.token }}" |
owner |
The repository owner. If unspecified, this will default to the owner of the current repository. | "" |
pull-number |
The pull request number to get | "0" |
repo |
The name of the repository. If unspecified, this will default to the current repository. | "" |
retries |
The number of times to attempt to retry if this fails. | "0" |
retry-exempt-status-codes |
A list of error-codes that are exempt from being retried. | "400,401,403,404,422" |
Name | Description |
---|---|
assignees |
The assignee(s) for this pull requst, as a JSON array of string logins |
assignees-count |
The number of assignee(s) for this pull requst |
body |
The body of this PR |
draft |
Whether the PR is a draft PR |
labels |
The labels assigned to this PR, as a JSON array of label names |
labels-count |
The number of labels assigned to this PR |
locked |
Whether this issue is currently locked |
merged |
Whether the PR is merged. |
pull-number |
The pull request number |
state |
The state of this PR |
team-reviewers |
The team revieweers for this pull requst, as a JSON array of string logins |
team-reviewers-count |
The number of team reviewers assigned to this pull request |
time-since-create |
The amount of time since the pull request was created |
time-since-last-update |
The amount of time since the pull request was last updated |
title |
The title of this PR |
user-reviewers |
The user reviewers for this pull requst, as a JSON array of string logins |
user-reviewers-count |
The number of user reviewers assigned to this pull request |
Here is a very basic example of how to use the pulls/get
composite action
in a project (placeholders are used in place of real inputs):
run:
example-job:
# ...
steps:
# ...
- name: Get pull request
id: pulls-get # only necessary if using this action's output(s)
uses: bitwizeshift/actions-github/pulls/get@v1
with:
# Optional inputs
github-token: GITHUB_TOKEN
owner: OWNER
pull-number: PULL_NUMBER
repo: REPO
retries: RETRIES
retry-exempt-status-codes: RETRY_EXEMPT_STATUS_CODES
# ...
- name: Uses "Get pull request" Outputs
uses: example-actions/use-pulls-get@v3 # illustrative
with:
use-assignees: ${{ steps.pulls-get.outputs.assignees }}
use-assignees-count: ${{ steps.pulls-get.outputs.assignees-count }}
use-body: ${{ steps.pulls-get.outputs.body }}
use-draft: ${{ steps.pulls-get.outputs.draft }}
use-labels: ${{ steps.pulls-get.outputs.labels }}
use-labels-count: ${{ steps.pulls-get.outputs.labels-count }}
use-locked: ${{ steps.pulls-get.outputs.locked }}
use-merged: ${{ steps.pulls-get.outputs.merged }}
use-pull-number: ${{ steps.pulls-get.outputs.pull-number }}
use-state: ${{ steps.pulls-get.outputs.state }}
use-team-reviewers: ${{ steps.pulls-get.outputs.team-reviewers }}
use-team-reviewers-count: ${{ steps.pulls-get.outputs.team-reviewers-count }}
use-time-since-create: ${{ steps.pulls-get.outputs.time-since-create }}
use-time-since-last-update: ${{ steps.pulls-get.outputs.time-since-last-update }}
use-title: ${{ steps.pulls-get.outputs.title }}
use-user-reviewers: ${{ steps.pulls-get.outputs.user-reviewers }}
use-user-reviewers-count: ${{ steps.pulls-get.outputs.user-reviewers-count }}