Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

szksh-lab-2/example-github-action-update-pull-request-by-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

example-github-action-update-pull-request-by-comment

⚠️ This workflow is no longer needed

GitHub officially supports this feature. https://github.blog/changelog/2022-02-03-more-ways-to-keep-your-pull-request-branch-up-to-date/


Example of GitHub Actions Workflow to update pull request by pull request comment

Overview

If the branch is protected and Require branches to be up to date before merging is checked, you can update the pull request branch using Update branch button (Reference).

image

But if Require branches to be up to date before merging isn't checked, you can't update the pull request branch using Update branch button. This is inconvenient.

In stead of Update branch button, you can update the pull request easily by GitHub Actions.

Workflow

By posting the pull request comment /update (You can change the comment freely), the pull request is updated.

image

To run new Workflows by the update, GitHub Personal Access Token or GitHub App Token are required. secrets.GITHUB_TOKEN isn't unavailable.

Reference

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN will not create a new workflow run

Set up

  1. Create GitHub Personal Access Token or GitHub App
  2. Add Personal Access Token or GitHub App private key to GitHub Secrets
  3. Copy Workflow

In case of GitHub App, you have to install the App to the repository.

How to use

Post the pull request comment /update (You can change the comment freely)

image

LICENSE

MIT

Releases

No releases published

Packages

No packages published