Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to README how to checkout PR in issue_comment event #1248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
- [Checkout multiple repos (private)](#Checkout-multiple-repos-private)
- [Checkout pull request HEAD commit instead of merge commit](#Checkout-pull-request-HEAD-commit-instead-of-merge-commit)
- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event)
- [Checkout pull request on `issue_comment` event](#Checkout-pull-request-on-issue_comment-event)
- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token)

## Fetch all history for all tags and branches
Expand Down Expand Up @@ -212,6 +213,16 @@ jobs:
- uses: actions/checkout@v3
```

## Checkout pull request on `issue_comment` event

**Note:** The job must check if the issue is a pull request using `if: github.event.issue.pull_request` which skips it otherwise.

```yaml
- uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.issue.number }}/head
```

## Push a commit using the built-in token

```yaml
Expand Down