Skip to content

Fix automatic changelog generation for PR titles with markdown backticks and make workflow comment-triggered #317

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 5 commits into from
Aug 13, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 5, 2025

Problem

The GitHub workflow for automatically generating changelog entries had two issues:

  1. Markdown backticks were being stripped: When a PR title like "Support methods like __array_function__ on expressions" was processed, the backticks and content between them would disappear from the changelog entry due to shell command substitution.

  2. Workflow ran automatically on all PRs: The changelog workflow would run on every PR open/edit event, which may not always be desired.

Root Cause

The shell command substitution issue occurred because the GitHub workflow was passing PR titles to the shell using double quotes:

run: |
  python modify_changelog.py update_changelog \
    "${{ github.event.pull_request.number }}" \
    "${{ github.event.pull_request.title }}"

When the shell processed a title containing backticks like Support methods like \array_function` on expressions, it interpreted the backticks as command substitution, attempting to execute array_function` as a shell command.

Solution

  1. Fixed markdown backtick handling: Changed the workflow to use single quotes instead of double quotes around the PR title to prevent shell interpretation of special characters.

  2. Made workflow comment-triggered: Updated the workflow to only run when someone comments @actions-user changelog on a PR, giving users control over when changelog entries are generated.

The workflow now:

  • Triggers on issue_comment events instead of pull_request events
  • Only runs when the comment body contains @actions-user changelog
  • Uses the GitHub API to fetch PR details from the comment context
  • Preserves markdown formatting in PR titles

Testing

The core fix (single quotes) preserves markdown backticks correctly. The workflow changes allow manual control over changelog generation while maintaining all existing functionality.

Fixes #316.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

actions-user and others added 2 commits August 5, 2025 20:06
Co-authored-by: saulshanabrook <1186124+saulshanabrook@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Fix automatic generic of changelog entries with markdown Fix automatic changelog generation for PR titles with markdown backticks Aug 5, 2025
Copilot finished work on behalf of saulshanabrook August 5, 2025 20:08
@Copilot Copilot AI requested a review from saulshanabrook August 5, 2025 20:08
Copy link

codspeed-hq bot commented Aug 5, 2025

CodSpeed WallTime Performance Report

Merging #317 will not alter performance

Comparing copilot/fix-316 (9281745) with main (bf04275)

Summary

✅ 7 untouched benchmarks

Copy link

codspeed-hq bot commented Aug 5, 2025

CodSpeed Instrumentation Performance Report

Merging #317 will not alter performance

Comparing copilot/fix-316 (08392aa) with main (f5a0db9)1

Summary

✅ 7 untouched benchmarks

Footnotes

  1. No successful run was found on main (08392aa) during the generation of this report, so f5a0db9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Member

@saulshanabrook saulshanabrook left a comment

Choose a reason for hiding this comment

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

Can you remove the tests for this?

@saulshanabrook
Copy link
Member

saulshanabrook commented Aug 13, 2025

@copilot Can you update this to remove the tests you added and also to change the action to only run when we have the string @actions-user changelog in the text of a comment on a PR?

…tions-user changelog'

Co-authored-by: saulshanabrook <1186124+saulshanabrook@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 13, 2025

Can you remove the tests for this?

Done - removed the tests for markdown backticks. Commit c771348

@copilot Can you update this to remove the tests you added and also to change the action to only run when we have the string @actions-user changelog in the text of a comment on a PR?

Done - removed the tests and updated the workflow to only trigger on comments containing "@actions-user changelog". The workflow now uses issue_comment events instead of pull_request events. Commit c771348

@Copilot Copilot AI changed the title Fix automatic changelog generation for PR titles with markdown backticks Fix automatic changelog generation for PR titles with markdown backticks and make workflow comment-triggered Aug 13, 2025
@Copilot Copilot AI requested a review from saulshanabrook August 13, 2025 01:30
Copilot finished work on behalf of saulshanabrook August 13, 2025 01:30
@saulshanabrook
Copy link
Member

@actions-user changelog

@saulshanabrook saulshanabrook marked this pull request as ready for review August 13, 2025 01:36
@saulshanabrook saulshanabrook merged commit 17af2f7 into main Aug 13, 2025
17 of 19 checks passed
@saulshanabrook saulshanabrook deleted the copilot/fix-316 branch August 13, 2025 01:41
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.

Fix automatic generic of changelog entries with markdown
3 participants