GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nefrob/pr-description: GitHub Action to update pull request descriptions.

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu

Latest commit

 

History

45 Commits
45 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
.yarn/releases
.yarn/releases
 
 
dist
dist
 
 
tests
tests
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.prettierrc.yaml
.prettierrc.yaml
 
 
.yarnrc.yml
.yarnrc.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 
babel.config.js
babel.config.js
 
 
index.js
index.js
 
 
package.json
package.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

Update Pull Request Description

GitHub action to append or replace text in a pull request description.

Gitmoji

Usage

This action supports pull_request and push events (where the push event ocurred on a branch with an open pull request).

Inputs

  • content: The content to append or replace in the PR body. Can be raw text or a file path. If a file path is provided, contentIsFilePath must be set to "true".
  • contentIsFilePath: Whether the content input is a file path. Defaults to "false".
  • contentRegex: The regex to match against the content. Used to select a specific part of the content to use. Defaults to "" (everything).
  • contentRegexFlags: The content matchregex flags to use. Defaults to "".
  • regex: The regex to match against the PR body and replace with content. Defaults to "---.*".
  • regexFlags: The regex flags to use. Defaults to "".
  • appendContentOnMatchOnly: Whether to skip appending the content to the PR body if no regex matches are found. Defaults to "false".
  • token: The GitHub token to use.

Note: append mode is the default behavior when no regex match is found for backwards compatibility with existing action users. This may change in future minor/major versions and will be noted in the changelog.

Example Workflows

  • Simple replace all text in the PR description with Hello there!:

    on:
        pull_request:
    
    jobs:
        update-pr-description:
            runs-on: ubuntu-latest
            steps:
                - name: Checkout
                  uses: actions/checkout@v4
                - name: Update PR Description
                  uses: nefrob/[email protected]
                  with:
                      content: "Hello there!"
                      regex: ".*"
                      regexFlags: s
                      token: ${{ secrets.GITHUB_TOKEN }}

    Body before:

    Existing
    Body

    Body after:

    Hello there!
  • Reading from a file:

    on:
        pull_request:
    
    jobs:
        update-pr-description:
            runs-on: ubuntu-latest
            steps:
                - name: Checkout
                  uses: actions/checkout@v4
                - name: Update PR Description
                  uses: nefrob/[email protected]
                  with:
                      content: path/to/file.txt
                      contentIsFilePath: true
                      regex: ".*"
                      token: ${{ secrets.GITHUB_TOKEN }}

    File content:

    Hello there!
    

    Body before:

    Existing body

    Body after:

    Hello there!
  • Replace text in between comments:

    on:
        pull_request:
    
    jobs:
        update-pr-description:
            runs-on: ubuntu-latest
            steps:
                - name: Checkout
                  uses: actions/checkout@v4
                - name: Update PR Description
                  uses: nefrob/[email protected]
                  with:
                      content: "<!-- start match -->\nHello there!\n<!-- end match -->"
                      regex: "<!-- start match -->.*?<!-- end match -->"
                      regexFlags: ims
                      token: ${{ secrets.GITHUB_TOKEN }}

    Body before:

    <!-- start match -->
    Anything in between these comments will be replaced by a push to the PR.
    <!-- end match -->
    

    Body after:

    <!-- start match -->
    Hello there!
    <!-- end match -->
    

    This is particularly useful when paired with a pull_request_template.md that includes comments like these for automatic updates on every PR.

  • Match a specific part of the content:

    on:
        pull_request:
    
    jobs:
        update-pr-description:
            runs-on: ubuntu-latest
            steps:
                - name: Checkout
                  uses: actions/checkout@v4
                - name: Update PR Description
                  uses: nefrob/[email protected]
                  with:
                      content: path/to/CHANGELOG.md
                      contentIsFilePath: true
                      contentRegex: "^##([\\s\\S]*?)(?=\\n##|$)"
                      contentRegexFlags: g
                      regex: ".*"
                      token: ${{ secrets.GITHUB_TOKEN }}

    File content:

    ## 1.0.2 Bug fixes
    - Fixed bug #4
    - Fixed bug #3
    
    ## 1.0.1 Bug fixes
    - Fixed bug #2
    - Fixed bug #1
    

    Body before:

    Existing body
    

    Body after:

    ## 1.0.2 Bug fixes
    - Fixed bug #4
    - Fixed bug #3
    

    This could be used to extract the latest changes from a changelog.md or similar.

About

GitHub Action to update pull request descriptions.

github.com/marketplace/actions/update-pr-description

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

12 stars

Watchers

1 watching

Forks

12 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.