question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Trim spaces from signature comment

See original GitHub issue

Is your feature request related to a problem? Please describe. When users copy the signing line into a comment (“'I have read the CLA Document…”), it is often copied with extra spaces or new lines. Since the action is comparing the comment’s content strictly to the expected line, it is not recognized as a signing. We sometimes have to ask the users to try again multiple times until they get it right.

Describe the solution you’d like It would be nice if the action would know to trim extra lines and spaces when comparing to the expected line. I know the comparison happens in my own workflow and that the solution should probably be there, but I’m reaching out to see maybe someone run into the same problem and has a solution.

Describe alternatives you’ve considered

  1. Github Action offers a contains() function, but then it ignores extra words that might make the signing invalid.
  2. Make the comparison inside the Action step itself and not in the workflow (would mean the step will run on every comment, which might be a waste)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
RobiNinocommented, Jan 21, 2021

Thanks @yahavi.

@ibakshay, @AndrewGable, Just to clarify, the solution only works if both #69 & @yahavi’s above comment are used together. The regex makes the CLA action accept comments with spaces (i.e not strict as ==), and the trim() in #69 handles those spaces inside the CLA action.

This works for me, closing the issue.

0reactions
yahavicommented, Jan 21, 2021

I would recommend using action-regex-match to better deal with newlines:

- uses: actions-ecosystem/action-regex-match@v2
id: sign
with:
    text: ${{ github.event.comment.body }}
    regex: '\s*I have read the CLA Document and I hereby sign the CLA\s*'

- uses: actions-ecosystem/action-regex-match@v2
id: recheck
with:
    text: ${{ github.event.comment.body }}
    regex: '\s*recheckcla\s*'

- name: "CLA Assistant"
uses: cla-assistant/github-action@v2.0.3-alpha
if: ${{ steps.recheck.outputs.match != '' || steps.sign.outputs.match != '' }} || github.event_name == 'pull_request_target'
# Now that #69 is merged, comment body with newlines won't be ignored inside the cla-assistent Action
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature] Trim spaces from signature comment #57 - GitHub
Since the action is comparing the comment's content strictly to the expected line, it is not recognized as a signing. We sometimes have...
Read more >
How to Remove Double Spacing in E-mail Signature Using ...
Part of the series: Microsoft Outlook E-mail Signatures. When using Microsoft Outlook, remove double spaces in e-mail signatures by ...
Read more >
Java String trim() method with Example - GeeksforGeeks
The trim() method in Java String is a built-in function that eliminates leading and trailing spaces. ... Method Signature: public String ...
Read more >
Outlook signature - remove space : r/Office365 - Reddit
No matter what I try to do, my Outlook signature has padding/spacing around it and it doesn't line up with the rest of...
Read more >
Unusual Spaces between Agent Text and Agent signature
After the Agent text there is no new line. Here a screenshot of our signature markup: How can we remove the new lines?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found