Skip to content

Close PR from Issue

Actions
Close the PR when the related issue is closed
1.2.0
Latest
Star (0)

close-pr-from-issue

Github Action to close the PR when the related issue is closed.

Usage

on:
  issues:
    types: [closed]

# See the "Workflow Permissions" section below for details.
permissions:
  contents: write
  issues: write
  pull-requests: write

jobs:
  close-pr-from-issue:
    runs-on: ubuntu-latest
    steps:
      - name: Close PR from Issue
        uses: kjuly/close-pr-from-issue@main

Optional Inputs

Options (with) Default Description
issue_comment_key 'tracked at PR #' The key string of relevant comments that mention the PR.
delete_branch 'true' Whether to delete the branch after closing, default: 'true'.
leave_comment_on_issue 'true' Whether to comment on the issue after the relevant PR is closed.
skip_checkout 'false' Whether caller workflow repo checkout should be skipped. If you've done this in the caller workflow, set this to 'true' to skip duplicate work.
token ${{github.token}} Github token or PAT. Only required if you need to access a private repo under the same user/org scope.

Workflow Permissions

Scope Permission Description
contents read Checkout the repo.
contents write Delete the branch to merge, required when delete_branch = 'true'.
issues write Leave a comment on the issue, required when leave_comment_on_issue = 'true'.
pull-requests write Close PR, required.

Permissions setting is only needed if your repo has restricted permissions on the GITHUB_TOKEN.

You can confirm your repo's workflow permissions in

Settings > Code and automation > Actions > General > Workflow permissions

Close PR from Issue is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Close the PR when the related issue is closed
1.2.0
Latest

Close PR from Issue is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.