-
Notifications
You must be signed in to change notification settings - Fork 121
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
Github action asserting license statement in PR description #1892
Github action asserting license statement in PR description #1892
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1892 +/- ##
==========================================
- Coverage 78.50% 78.47% -0.03%
==========================================
Files 585 585
Lines 99516 99516
Branches 14244 14243 -1
==========================================
- Hits 78122 78096 -26
- Misses 20759 20784 +25
- Partials 635 636 +1 ☔ View full report in Codecov by Sentry. |
# Normalize line endings (convert CRLF to LF) | ||
PR_DESCRIPTION=$(echo "${PR_DESCRIPTION}" | tr -d '\r') | ||
|
||
# Escape quotes in PR description | ||
PR_DESCRIPTION=$(echo "${PR_DESCRIPTION}" | sed 's/"/\\"/g; s/'"'"'/\\'"'"'/g') | ||
|
||
# Remove all spaces and tabs | ||
PR_DESCRIPTION=$(echo "${PR_DESCRIPTION}" | tr -d ' \t') | ||
LICENSE_STATEMENT=$(echo "${LICENSE_STATEMENT}" | tr -d ' \t') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, what is this needed for? The license statement is a single sentence so there should be no new lines, and a space is a space and should match right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. If I did:
- pushing PR with correct statement in the PR description
- modified PR statement to incorrect and then re-ran the job.
- modified PR statement back to correct and then re-ran the job.
(1) and (2) would return as expected i.e. former succeeded, the latter failed. But (3) would not return as expected, it would fail. Removing spaces etc. seems to have removed something that got encoded unexpected(?)
Issues:
Related to P151534254
Description of changes:
Simple action that asserts whether the license statement
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
exists in the PR description.I tested this by:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.