Skip to content

Allow specifiying custom skip label instead of hard-coded 'no-issue' #682

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

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ GitHub action to check if pull requests have their corresponding issues linked,
| `comment` | No | `true` | A boolean value that allow the action to create a comment. |
| `custom-body-comment` | No | "No linked issues found. Please add the corresponding issues in the pull request description. <br/> [Use GitHub automation to close the issue when a PR is merged](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)" | Custom body PR comment. |
| `loose-matching` | No | `false` | A boolean value indicating whether the action should verify linked issues inside a PR's description, merging onto any branch (including non-default branches like `main` or `master`). When enabled, this option supports both local issues (e.g., `#123`) and external ones (e.g., `https://github.com/org-name/repo/issues/123` or `org-name/repo#123`). Associating a pull request with an issue requires the use of any of the [supported keywords](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) in the pull request's description (e.g., `fixes #123`).|
| `skip-linked-issued-check-label` | No | `no-issue` | A label that causes the action to execute but skip the actual linked issues check. If the check is skipped, the `check_skipped` output is set to `true`. Any present comments added by this action are also deleted. Useful when incorporating this action into multi-action workflows.|

## Outputs

| output | description |
|-----------------------|------------------------------------------------------------------|
| `linked_issues_count` | The total number of issues linked to your pull request. |
| `issues` | A stringified array containing the numbers of the linked issues, of the form ["some/repo#123", "another/repository#456"] |
| `check_skipped` | Will be set to `true` if the action was skipped due to a `no-issue` label present on the PR. |

| `check_skipped` | Will be set to `true` if the linked issues check was skipped. |

## Standard Usage

Expand Down
4 changes: 2 additions & 2 deletions __mocks__/@actions/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ module.exports = {
},
],
},
labels: github.context.withNoIssueLabel
labels: github.context.withLabel
? {
nodes: [
{
name: "foo",
},
{
name: "no-issue",
name: github.context.withLabel,
},
{
name: "bar",
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ inputs:
description: "A boolean value that allow PR to link issues on any branch"
required: false
default: "false"
skip-linked-issued-check-label:
Copy link
Preview

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input name in action.yml ('skip-linked-issued-check-label') does not match the key used in src/util.js ('skip-linked-issues-check-label'). Please standardize the naming across all files.

Suggested change
skip-linked-issued-check-label:
skip-linked-issues-check-label:

Copilot uses AI. Check for mistakes.

description: "A label that causes the action to execute but skip the actual linked issues check. If the check is skipped, the `check_skipped` output is set to `true`. Any present comments added by this action are also deleted. Useful when incorporating this action into multi-action workflows."
required: false
default: 'no-issue'

outputs:
linked_issues_count:
description: 'The total number of issues linked to your pull request.'
issues:
description: 'A stringified array containing the numbers of the linked issues, of the form ["some/repo#123", "another/repository#456"]'
check_skipped:
description: 'Set to true if the linked issues check is skipped.'

runs:
using: 'node20'
Expand Down
Loading
Loading