Skip to content

Conversation

@xinsong-cui
Copy link
Contributor

@xinsong-cui xinsong-cui commented Oct 16, 2025

Issue #

Description of changes

Add a GitHub Action that automatically comments on issues referenced in PRs merged since the last release.
Test pr: aws/aws-sdk-kotlin#1711
Test issue: aws/aws-sdk-kotlin#1714 (comment)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@xinsong-cui xinsong-cui marked this pull request as ready for review October 16, 2025 16:38
@xinsong-cui xinsong-cui requested a review from a team as a code owner October 16, 2025 16:38
Copy link
Contributor

@ianbotsf ianbotsf left a comment

Choose a reason for hiding this comment

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

Looking better, only minor nits/questions left.

Comment on lines 61 to 64
if ! gh issue comment "$issue_number" --body "A change related to this issue was included in release: $CURRENT_TAG"; then
echo "::error::Failed to comment on issue #$issue_number"
exit 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Does Markdown work in the --body argument? If so, it'd be nice to link readers to the release itself:

gh issue comment "$issue_number" --body "A change related to this issue was included in [release **$CURRENT_TAG**](https://github.com/${{ github.repository }}/releases/tag/$CURRENT_TAG)."

while read -r issue_number; do
if [ -n "$issue_number" ]; then
echo "Commenting on issue #$issue_number"
if ! gh issue comment "$issue_number" --body "A change related to this issue was included in [release **$CURRENT_TAG**](https://github.com/${{ github.repository }}/releases/tag/$CURRENT_TAG)."; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! I was taking a look at your example and I don't know how often this will be necessary; when a lot of changes are being released related to an issue, it will be hard to tell what change each comment is talking about.

Suggestion: It would be nice to include the pull request from each change

A change related to this issue was included in release.

while read -r issue_number; do
if [ -n "$issue_number" ]; then
echo "Commenting on issue #$issue_number"
if ! gh issue comment "$issue_number" --body "A change related to this issue was included in [release **$CURRENT_TAG**](https://github.com/${{ github.repository }}/releases/tag/$CURRENT_TAG)."; then
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I don't think we need the word "release" here, just $CURRENT_TAG should be fine?

A change related to this issue was included in v1.5.64

Copy link
Member

Choose a reason for hiding this comment

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

Rather than checking the PR body for GitHub issue links, I was hoping we could be more intentional with these comments by using changelog entries. I think the current implementation will be much noisier than it needs to be

@xinsong-cui xinsong-cui requested a review from lauzadis October 20, 2025 20:59
for issue in $PR_ISSUES; do
if [ -n "$issue" ]; then
echo "Commenting on issue #$issue"
if ! gh issue comment "$issue" --body "A [change](https://github.com/${{ github.repository }}/pull/$pr_number) related to this issue was included in [**$CURRENT_TAG**](https://github.com/${{ github.repository }}/releases/tag/$CURRENT_TAG)."; then
Copy link
Member

Choose a reason for hiding this comment

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

I'm seeing a test that looks like this:

A aws/aws-sdk-kotlin#1710 related to this issue was included in v1.5.64.

(no "change"). It looks correct here, so I just want to confirm you fixed it after that test ran?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, thats being fix [change](https://github.com/${{ github.repository }}/pull/$pr_number)

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