Skip to content

Replaces [#PR] with an actual PR number in a description body

License

Notifications You must be signed in to change notification settings

matyas-igor/pr-number-action

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

Repository files navigation

Replaces [#PR] with an actual number in a pull request description

This action looks at the description of a pull-request and replaces [#PR] with an actual number.

Inputs

github-token

Required ${{ secrets.GITHUB_TOKEN }}

pattern

Pattern to use for ID replacement.

Optional [#PR]

Usage

Inside .github/PULL_REQUEST_TEMPLATE.md:

Preview: https://deploy-preview-[#PR]--some-app.netlify.app

And inside .github/workflows/PR.yml:

name: Update PR number
on: [pull_request]

jobs:
  update:
    name: Update PR number
    runs-on: ubuntu-latest
    steps:
    - uses: matyas-igor/pr-number-action@v1
      with:
        github-token: "${{ secrets.GITHUB_TOKEN }}"
        # pattern: "[#PR]"