Skip to content

Conversation

@alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn commented Jan 12, 2026

Closes #1592

What has been done to verify that this works as intended?

  • added some tests for the regex
  • forked this repo, merged the PR to master in the fork, and tested with various new issues and different structures of commit message. REVIEW: is this necessary?

Why is this the best possible solution? Were any other approaches considered?

Another approach would be to extract the JS of the script section of close-issues.yml into a .js file, and write more traditional tests. However, this would be a much more significant change to the overhead of the workflow, as actions/checkout would have to be added, and NodeJS would need to be installed.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

No effect.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • branched off and targeted the next branch OR only changed documentation/infrastructure (master is stable and used in production)
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@alxndrsn alxndrsn changed the base branch from master to next January 30, 2026 06:59
@alxndrsn alxndrsn marked this pull request as ready for review January 30, 2026 07:24
Copy link
Contributor

@latin-panda latin-panda left a comment

Choose a reason for hiding this comment

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

💛

const body = context.payload.pull_request.body || "";
const closedIssues = new Set();
const issueRegex = /(Closes|Fixes|Resolves)\s*:?\s+#(\d+)/gi;
const issueRegex = /(Closes|Fixes|Resolves)\s*:?\s+(?:(?:https:\/\/)?github.com\/getodk\/central\/issues\/|getodk\/central#|#)(\d+)/gi;
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional:
It could support variants of the same words, e.g., Close, Closes, Closed

Suggested change
const issueRegex = /(Closes|Fixes|Resolves)\s*:?\s+(?:(?:https:\/\/)?github.com\/getodk\/central\/issues\/|getodk\/central#|#)(\d+)/gi;
const issueRegex = /((?:close|fix|resolve)(?:s|d|es|ed)?)\s*:?\s+(?:(?:https:\/\/)?github.com\/getodk\/central\/issues\/|getodk\/central#|#)(\d+)/gi;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I'll follow up 👍

@alxndrsn alxndrsn merged commit ef1571c into getodk:next Jan 30, 2026
5 checks passed
@alxndrsn alxndrsn deleted the close-issues-variants branch January 30, 2026 09:58
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.

Merging PRs to next branch doesn't close associated Issues

2 participants