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

Github action asserting license statement in PR description #1892

Merged

Conversation

torben-hansen
Copy link
Contributor

@torben-hansen torben-hansen commented Oct 1, 2024

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:

  • pushing PR with correct statement in the PR description. Action job succeeded.
  • modified PR statement to incorrect and then re-ran the job. Action job failed.
  • modified PR statement back to correct and then re-ran the job. Action job succeeded.

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.

@torben-hansen torben-hansen requested a review from a team as a code owner October 1, 2024 15:12
@torben-hansen torben-hansen enabled auto-merge (squash) October 1, 2024 16:28
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.47%. Comparing base (36e0307) to head (0f546cf).

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.
📢 Have feedback on the report? Share it here.

Comment on lines +56 to +64
# 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')
Copy link
Contributor

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?

Copy link
Contributor Author

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:

  1. pushing PR with correct statement in the PR description
  2. modified PR statement to incorrect and then re-ran the job.
  3. 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(?)

@torben-hansen torben-hansen merged commit 4bb4eab into aws:main Oct 2, 2024
106 of 111 checks passed
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.

4 participants