Skip to content
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

Trim issue titles #88

Merged
merged 3 commits into from
Aug 2, 2023
Merged

Trim issue titles #88

merged 3 commits into from
Aug 2, 2023

Conversation

martincostello
Copy link
Contributor

Somehow I managed to create a series of issues last month (I assume some weird copy-paste thing) that contained \r at the end of their titles. For example, this pull request, of which here's a snippet:

{
  "url": "https://api.github.com/repos/martincostello/update-static-assets/pulls/282",
  "id": 1454674049,
  "node_id": "PR_kwDOHxs9d85WtJCB",
  "html_url": "https://github.com/martincostello/update-static-assets/pull/282",
  "number": 282,
  "state": "closed",
  "title": "Add actionlint\r", // <-- No idea how I managed to do this!
  "user": {
    "login": "martincostello"
  }
}

This then causes the Markdown table rendering to break (example, notice the PR links starting to appear in the first column).

This pull request fixes that by trimming the issue title before rendering.

It also fixes a test assertion that is failing on my computer even without these changes. As I'm based in London, I assume that makes me equal to UTC here (even though we're currently in Daylight Savings at GMT+1)?

Fix failing assertion if the time is exactly the value.
Trim issue titles to fix Markdown rendering.
It's any whitespace, not just trailing.
@zkoppert zkoppert added the bug Something isn't working label Aug 2, 2023
Copy link
Member

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

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

👍🏻

@zkoppert
Copy link
Member

zkoppert commented Aug 2, 2023

Thanks for taking the time to submit this pull request!! Appreciate the fix and adding it to the tests.

@zkoppert zkoppert merged commit 9b99daa into github:main Aug 2, 2023
@martincostello martincostello deleted the trim-titles branch August 2, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants