From c65a4f39b39405aa0ea62f9398cff9a2eb56ce67 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sat, 8 Feb 2020 16:04:23 +0900 Subject: [PATCH] Update documentation --- README.md | 15 +++++++++++++++ docs/concepts-guidelines.md | 21 --------------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 6903d72..ee6c498 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,21 @@ If there is some reason you need to use `actions/checkout@v1` the following step - run: git checkout "${GITHUB_REF:11}" ``` +Checking out a branch from a different repository from where the workflow is executing will make *that repository* the target for the created pull request. In this case, a `repo` scoped [Personal Access Token (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) is required. + +```yml + - uses: actions/checkout@v2 + with: + token: ${{ secrets.PAT }} + repository: owner/repo + + # Create changes to pull request here + + - uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.PAT }} +``` + ### Branch naming For branch naming there are two strategies. Create a fixed-name pull request branch that will be updated with new changes until it is merged or closed, OR, always create a new unique branch each time there are changes to be committed. diff --git a/docs/concepts-guidelines.md b/docs/concepts-guidelines.md index ddbd5b0..f840c6c 100644 --- a/docs/concepts-guidelines.md +++ b/docs/concepts-guidelines.md @@ -7,7 +7,6 @@ This document covers terminology, how the action works, and general usage guidel - [How the action works](#how-the-action-works) - [Guidelines](#guidelines) - [Providing a consistent base](#providing-a-consistent-base) - - [The pull request target repository](#the-pull-request-target-repository) - [Pull request events](#pull-request-events) - [Restrictions on forked repositories](#restrictions-on-forked-repositories) - [Tag push events](#tag-push-events) @@ -73,26 +72,6 @@ jobs: Although rare, there may be use cases where it makes sense to execute the workflow on a branch that is not the base of the pull request. In these cases, the base branch can be specified with the `base` action input. The action will attempt to rebase changes made during the workflow on to the actual base. -### The pull request target repository - -The action determines what repository it should create the pull request in based on the checked out repository. - -Checking out a branch from a different repository from where the workflow is executing will make *that repository* the target for the created pull request. In this case, a `repo` scoped [Personal Access Token (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) is required. - -```yml - - uses: actions/checkout@v2 - with: - token: ${{ secrets.PAT }} - repository: owner/repo - - - name: Create changes to pull request - run: - - - uses: peter-evans/create-pull-request@v2 - with: - token: ${{ secrets.PAT }} -``` - ### Pull request events Workflows triggered by `pull_request` events will by default check out a [merge commit](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-event-pull_request). To prevent the merge commit being included in created pull requests it is necessary to checkout the `head_ref`.