Skip to content

feat: linkify issue/pr reference numbers with proper markdown links - #48

Merged
yCodeTech merged 3 commits into
refactor/update-changelog-ci-scriptfrom
feat/update-changelog-ci/linkify-issue-and-pr-references
Aug 20, 2026
Merged

feat: linkify issue/pr reference numbers with proper markdown links#48
yCodeTech merged 3 commits into
refactor/update-changelog-ci-scriptfrom
feat/update-changelog-ci/linkify-issue-and-pr-references

Conversation

@yCodeTech

@yCodeTech yCodeTech commented Aug 19, 2026

Copy link
Copy Markdown
Owner

This PR adds linkify functionality in the update changelog CI script to find all issue/PR references like #NN in the changelog section it's adding, resolve the GitHub URLs, and linkify them as markdown links like [#NN](<url>).

Linkify functions:

  • The linkifyReferences function is the main linkify function that calls all other intermediate functions and replaces the bare references with the markdown link.

  • findBareReferences finds all bare issue or pr references (#NN) that aren't already linked within specified text, and collect the unique numbers.

  • findClosingKeywordReferences is a utils function in the new utils.mjs script that finds all bare issue-closing keyword references like close(s/d) #NN, fix(es/ed) #NN, resolve(s/d) #NN, and collect the unique numbers.

  • resolveClosingKeywordReferenceUrl resolves the URL for issue-closing keyword references. It only needs to construct the URL from the context and reference number without an API call since closing keywords always references issues.

  • resolveBareReferenceUrl resolves the URL for all other bare references, using the GitHub REST API to lookup the reference number to determine whether it's an issue or a pull request, and retrieves the URL from the API.

Changelog CI enchancements:

  • Updated the changelog CI permissions to include issues: read.

  • Updated various CI steps to checkout and copy the new utils.mjs script.

Other improvements:

  • Moved various variables from the update-changelog.mjs script into the new utils.mjs script for better organisation of cross-file variables.

  • Moved various global variables in the check-changelog-exclusions.mjs script to be local variables in the checkExclusions function as they don't need to be global variables since they're not used anywhere else.

- Added `linkifyReferences` function to orchestrate all other intermediate functions in order to find issue/pr references, resolve the correct GitHub URLs and linkify them into proper markdown links in the new changelog section. Also added its function call to the `formatPRDescription` function.

- Added `findBareReferences` function to find all bare issue or pr references that aren't already linked within specified text, and collect the unique numbers.

- Added `findClosingKeywordReferences` utils function in the new utils script to find all bare references that are preceded with closing keywords like close(s/d), fix(es/ed), resolve(s/d), and collect the unique numbers.

- Added `resolveClosingKeywordReferenceUrl` function to resolve the closing keyword issue reference URL. It only needs to construct the URL from the context and reference number without an API call since closing keywords always references issues.

- Added `resolveBareReferenceUrl` function to resolve the bare reference URL, using the GitHub REST API to lookup the reference number and determine whether it's an issue or a pull request, and returns the correct URL, or an empty string if errors occurred.

- Updated the changelog CI permissions to include reading issues.

- Updated the "Sparse checkout exclusion script" step in the CI to also checkout the utils script.

- Updated the "Copy changelog script" step in the CI to also copy the utils script to a temp file so it can be imported properly in the temp update-changelog file.
- Moved `TYPE_TO_SECTION` and `INCLUDED_TYPES` const variables from the update-changelog script to the utils script for better organisation of cross-file variables. Updated the references in the update-changelog script to use the `utils` namespace import.

- Changed the `update-changelog` import to `utils` import in the check-changelog-exclusions script.

- Updated the "Sparse checkout exclusion script" step name to "Sparse checkout scripts for PR exclusion checks" in the changelog CI so that it doesn't sound like it's excluding the specified files.

- Removed the update-changelog script from the sparse checkout step in the changelog CI.
… function

- Moved the `ALL_COMMIT_TYPES` and `typeRegex` global variables to be local variables in the `checkExclusions` function of the `check-changelog-exclusions` script. This is because they're not used in any other function so they don't need to be global variables. Also made the `ALL_COMMIT_TYPES` all lowercase. All uppercase should be kept for global variables/constants.
@yCodeTech yCodeTech added the enhancement New feature or quality of life enhancement label Aug 19, 2026
@yCodeTech
yCodeTech merged commit ad2fa06 into master Aug 20, 2026
1 check passed
@yCodeTech
yCodeTech deleted the feat/update-changelog-ci/linkify-issue-and-pr-references branch August 20, 2026 17:49
github-actions Bot added a commit that referenced this pull request Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or quality of life enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant