Skip to content

Conversation

@tidy-dev
Copy link
Contributor

@tidy-dev tidy-dev commented Sep 30, 2025

Introduces multiple workflow files to automate issue and PR triage, labeling, commenting, and closing. Includes actions for handling invalid issues/PRs, single-word issues, feature requests, stale issues, lack of response, and label management to streamline repository maintenance.

It will:

  1. Label incoming issues with triage
  2. Removes triage if another label is added that is not more-info-needed
  3. When more-info-needed is applied, it will automatically close the issue in 1 week if no response.
  4. On close of an issue, the triage is automatically removed.
  5. When unable-to-reproduce is added, a canned response asking for more detailed information is added.
  6. When enhancement New feature or request is added, a canned response informing users it has been added to the backlog.
  7. When a single word issue is opened, it is auto closed as spam.
  8. When invalid This doesn't seem right is added, the issue or pr is closed.

Introduces multiple workflow files to automate issue and PR triage, labeling, commenting, and closing. Includes actions for handling invalid issues/PRs, single-word issues, feature requests, stale issues, lack of response, and label management to streamline repository maintenance.
Copilot AI review requested due to automatic review settings September 30, 2025 14:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces automated GitHub Actions workflows for comprehensive issue and pull request management, implementing triage automation, labeling, and lifecycle management to reduce manual repository maintenance overhead.

  • Automated triage labeling for new issues with smart label management
  • Automated responses and actions for specific issue states (unable-to-reproduce, enhancement, invalid)
  • Automated closure of spam and invalid issues with appropriate messaging

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.github/workflows/triage-issues.yml Automatically adds triage labels to new/reopened issues and re-adds when more-info-needed is removed
.github/workflows/remove-triage-label.yml Removes triage label when other labels are applied (except more-info-needed)
.github/workflows/on-issue-close.yml Cleans up triage labels when issues are closed
.github/workflows/unable-to-reproduce-comment.yml Adds standardized comment and more-info-needed label for unable-to-reproduce issues
.github/workflows/feature-request-comment.yml Adds backlog notification comment for enhancement-labeled issues
.github/workflows/no-response.yml Automatically closes issues with more-info-needed label after 7 days of no response
.github/workflows/stale-issues.yml Marks issues as stale after 365 days but doesn't auto-close them
.github/workflows/close-single-word-issues.yml Automatically closes issues with single-word titles as spam
.github/workflows/close-invalid.yml Automatically closes issues/PRs when labeled as invalid

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

tidy-dev and others added 3 commits September 30, 2025 10:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tidy-dev
Copy link
Contributor Author

OSPO License Check.. Workflows cannot be required from a less visible repository... hmm.

@RyanHecht RyanHecht self-requested a review September 30, 2025 14:56
@tidy-dev tidy-dev merged commit afd27aa into main Sep 30, 2025
2 checks passed
Copy link
Contributor

@andyfeller andyfeller left a comment

Choose a reason for hiding this comment

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

Nothing blocking, but had some ideas to enhance the experience and maintainability 🙇

Comment on lines +5 to +7
on:
issues:
types: [labeled]
Copy link
Contributor

Choose a reason for hiding this comment

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

question: is it worth consolidating labeled workflows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly.. I kind of like the organization of separate .ymls for separate purposes... but not sure if that sacrifices anything action runner wise.

Comment on lines +5 to +7
on:
issues:
types: [labeled]
Copy link
Contributor

Choose a reason for hiding this comment

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

question: doesn't this need the pull_request_target event to handle PRs?

Suggested change
on:
issues:
types: [labeled]
on:
issues:
types: [labeled]
pull_request_target:
types: [labeled]

Comment on lines +24 to +26
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh issue close ${{ github.event.issue.html_url }}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest: use intermediate variables to avoid interpolating context in run blocks

Suggested change
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh issue close ${{ github.event.issue.html_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
URL: ${{ github.event.issue.html_url }}
run: gh issue close $URL

Comment on lines +42 to +44
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
- run: gh issue comment "$NUMBER" --body "$BODY"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consolidating these runs into a single step with a name and moving the env from the job to the step would make this easier to maintain

Suggested change
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
- run: gh issue comment "$NUMBER" --body "$BODY"
steps:
- name: Update issue
run: |
gh issue edit "$NUMBER" --add-label "$LABELS"
gh issue comment "$NUMBER" --body "$BODY"

Comment on lines +16 to +44
- name: Close Single-Word Issue
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueTitle = context.payload.issue.title.trim();
const isSingleWord = /^\S+$/.test(issueTitle);

if (isSingleWord) {
const issueNumber = context.payload.issue.number;
const repo = context.repo.repo;

// Close the issue and add the invalid label
github.rest.issues.update({
owner: context.repo.owner,
repo: repo,
issue_number: issueNumber,
labels: ['invalid'],
state: 'closed'
});

// Comment on the issue
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: repo,
issue_number: issueNumber,
body: `This issue may have been opened accidentally. I'm going to close it now, but feel free to open a new issue with a more descriptive title.`
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: this might be an opportunity to utilize https://github.com/github/ai-moderator for detecting spam like this 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting - Sounds like a neat potential iteration.

Comment on lines +16 to +31
noResponse:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@v0.5.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
closeComment: >
Thank you for your issue!

We haven’t gotten a response to our questions above. With only the
information that is currently in the issue, we don’t have enough
information to take action. We’re going to close this but don’t
hesitate to reach out if you have or find the answers we need. If
you answer our questions above, this issue will automatically
reopen.
daysUntilClose: 7
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: I would have imaged the actions/stale would provide support for this 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be able to use it for the same thing. We implemented lee-dohm/no-response quite a bit (like years) before actions/stale was a thing and simply didn't look to change what wasn't broken. :D

Looks to me like actions/stale does have "only-labels" which would likely allow you to accomplish the same goal in conjunction to the same "more-info-needed" label as well as a 'close-issue-message"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants