Skip to content

Conversation

@szapp
Copy link
Contributor

@szapp szapp commented Jan 19, 2025

Hi @onmax! I noticed a small issue, that may break this GitHub Action in the future.

Checkboxes are parsed to allow both lowercase and uppercase markers, x and X.

const re = /^- \[([ Xx])\] (.+)$/

However, the check to identify a checkbox section only allow uppercase X.

const isCheckboxRegex = /^- \[[ X]\] /

Issues with lowercase x checkbox markers fail to be parsed.


This pull request adjusts the regular expression in the function isCheckbox to be case insensitive, much like the parsing.

This minor bug is becoming crucial, as GitHub is rolling out a new issues feature that uses lowercase x in issue templates. This results in this GitHub Action failing to parse issues submitted through an issue template.

I prepared three commits:

  • 77110ed Fixes the test, that let this issue go unnoticed, to make the test fail now.
  • 24cb2e1 Fixes the bug. The test now passes.
  • 0459ac5 Builds the GitHub Action.

szapp added 3 commits January 19, 2025 14:16
Although checkboxes are parsed with lower and upper case X, the check
in isCheckbox is case sensitive. This commit adjusts the test to reveal
the bug. Specifically, the test now fails if the first checkbox is
checked with a lower case x.
Allow checkboxes to be marked with an 'x' or 'X'.
@szapp szapp requested a review from onmax as a code owner January 19, 2025 15:25
@onmax
Copy link
Owner

onmax commented Jan 19, 2025

Thank you!

@onmax onmax merged commit e2a10b8 into onmax:main Jan 19, 2025
1 check passed
@szapp szapp deleted the fix-checkbox-x branch January 19, 2025 17:27
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.

2 participants