feat: support auto commenting on closed linked issues after release - #50
Open
yCodeTech wants to merge 1 commit into
Conversation
- Refactored `findClosingKeywordReferences` utils function to optionally match already linked references via Markdown links with a new `matchMarkdownLinks` param.
- Added new step in the publish CI to comment on closed issues that are referenced in the changelog of the newly released version. This step takes place after the publishing step, and uses the new script file.
- Added new `comment-on-linked-issues` script file for the functionality of finding any reference numbers in the changelog and auto comment on the issues that the new release has been published.
The script has:
- `commentOnLinkedIssues` main function to retrieve the closing issues from the changelog version entry, and add comment on them to let the issue author know that the resolution of the issues has been released in a new version.
This uses the `findClosingKeywordReferences` utils function to retrieve the issue-closing keyword references using the new `matchMarkdownLinks` param as `true`. The script also uses the Octokit GitHub API to create the comment.
- `extractChangelogEntry` function to extract the changelog section for a specified version.
- `commentExists` function to check if a comment already exists for the specific version on the issue. This uses the Octokit GitHub API to paginate through the issue's comments and filters the comments that match the criteria.
- Updated permissions to allow writing issues in the publish CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds automation to comment on closed issues that are referenced in a release's changelog entry, notifying users that their issues have been resolved and released. The main changes include introducing a new script to identify and comment on relevant issues, and integrating this script into the publish workflow.
Automation for commenting on closed, referenced issues:
.github/scripts/comment-on-linked-issues.mjs, which extracts referenced issues/PRs from the changelog, follows closing keywords through referenced PRs, and posts a release notification comment on closed issues..github/workflows/publish.ymlto run the new script after publishing, ensuring users are notified on closed issues included in the release.Refactored
findClosingKeywordReferencesutils function to optionally match already linked references via Markdown links with a newmatchMarkdownLinksparam.Added new step in the publish CI to comment on closed issues that are referenced in the changelog of the newly released version. This step takes place after the publishing step, and uses the new script file.
Added new
comment-on-linked-issuesscript file for the functionality of finding any reference numbers in the changelog and auto comment on the issues that the new release has been published.The script has:
commentOnLinkedIssuesmain function to retrieve the closing issues from the changelog version entry, and add comment on them to let the issue author know that the resolution of the issues has been released in a new version.The function uses the
findClosingKeywordReferencesutils function to retrieve the issue-closing keyword references using the newmatchMarkdownLinksparam astrue. The script also uses the Octokit GitHub API to create the comment.extractChangelogEntryfunction to extract the changelog section for a specified version.commentExistsfunction to check if a comment already exists for the specific version on the issue. This uses the Octokit GitHub API to paginate through the issue's comments and filters the comments that match the criteria.Updated permissions to allow writing issues in the publish CI.