Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be sure to define 'description' #35804

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Linking a pull request to an issue
intro: 'You can link a pull request {% ifversion link-existing-branches-to-issue %}or branch {% endif %}to an issue to show that a fix is in progress and to automatically close the issue when the pull request {% ifversion link-existing-branches-to-issue %}or branch {% endif %} is merged.'

Check warning on line 3 in content/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue.md

View workflow job for this annotation

GitHub Actions / lint-content

Liquid `ifversion` (and `elsif`) should not always be true

The Liquid ifversion condition 'link-existing-branches-to-issue' includes all possible versions and will always be true.

Check warning on line 3 in content/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue.md

View workflow job for this annotation

GitHub Actions / lint-content

Liquid `ifversion` (and `elsif`) should not always be true

The Liquid ifversion condition 'link-existing-branches-to-issue' includes all possible versions and will always be true.
redirect_from:
- /github/managing-your-work-on-github/managing-your-work-with-issues-and-pull-requests/linking-a-pull-request-to-an-issue
- /articles/closing-issues-via-commit-message
Expand All @@ -19,16 +19,16 @@
shortTitle: Link PR to issue
---

> [!NOTE]
> The special keywords in a pull request description are interpreted when the pull request targets the repository's _default_ branch. However, if the PR's base is _any other branch_, then these keywords are ignored, no links are created and merging the PR has no effect on the issues. **If you want to link a pull request to an issue using a keyword, the PR must be on the default branch.**

## About linked issues and pull requests

You can link an issue to a pull request manually or using a supported keyword in the pull request description.
You can link an issue to a pull request manually or using a supported keyword in the pull request description, that is, the summary text added by the author when they created the pull request.
MichaelChirico marked this conversation as resolved.
Show resolved Hide resolved

When you link a pull request to the issue the pull request addresses, collaborators can see that someone is working on the issue.

When you merge a linked pull request into the default branch of a repository, its linked issue is automatically closed. For more information about the default branch, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch).
When you merge a linked pull request into the **default branch** of a repository, its linked issue is automatically closed. For more information about the default branch, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch).

> [!NOTE]
> The special keywords in a pull request description are interpreted only when the pull request targets the repository's _default_ branch. If the pull request targets _any other branch_, then these keywords are ignored, no links are created, and merging the PR has no effect on the issues.

## Linking a pull request to an issue using a keyword

Expand Down Expand Up @@ -70,7 +70,7 @@
{% data reusables.pull_requests.click-development-in-pull-request %}
1. Click the issue you want to link to the pull request.

{% ifversion link-existing-branches-to-issue %}

Check warning on line 73 in content/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue.md

View workflow job for this annotation

GitHub Actions / lint-content

Liquid `ifversion` (and `elsif`) should not always be true

The Liquid ifversion condition 'link-existing-branches-to-issue' includes all possible versions and will always be true.

## Manually linking a pull request or branch to an issue using the issue sidebar

Expand Down
Loading