-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update check-cla
to customize which CLA repo to use
#91
Merged
+259
−119
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
ee9d811
Update check-cla to customize which CLA repo
kenodegard ec9f0b4
Adds set-commit-status action
kenodegard a3dded4
Update READMEs and descriptions
kenodegard 6c83ecc
Use JavaScript, not TypeScript
kenodegard 2b2d732
Don't need to authenticate Octokit object
kenodegard 5361102
Remove redundant debug statements
kenodegard 528c212
Dumb JS split
kenodegard 83dab52
Flatten await and keep try-catch simple
kenodegard b3b9940
Set author/committer and delete branch on merge
kenodegard 1542cb4
debugging
kenodegard 261fc09
Remove unused sha and labels
kenodegard 1928626
Update ids
kenodegard 00ae91f
Allow custom author/committer
kenodegard 8eee82e
Fix json formatting, update PR url
kenodegard 4729d17
Fix inputs
kenodegard b2db323
Fallback sha
kenodegard 9bdcc51
debugging comment payload
kenodegard 43ec963
Remove temporary raw const
kenodegard d8454ec
Optional react to comment
kenodegard 8ee0ba0
Add token to reaction
kenodegard 5ab5369
Replace rocket with eyes
kenodegard ebb06e5
Reduce noise
kenodegard a4ac617
Include classic PAT instructions
kenodegard 4f67ffb
GFM
kenodegard d66d4eb
Extract PR number for sticky comment
kenodegard 71c4f55
Support both PRs and "issues"
kenodegard 6146699
Extract metadata whether triggered as a PR or "issue" comment
kenodegard 5616a98
Group metadata steps
kenodegard 3c9f741
Update comments and step names
kenodegard ae8e19e
Use correct url
kenodegard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update comments and step names
commit 3c9f7412ddb7cbae8e5c67199ab6edaa2991f1fa
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ runs: | |
using: composite | ||
steps: | ||
# if triggered by a comment, leave a reaction | ||
- name: Comment Reaction | ||
- name: React to comment | ||
uses: peter-evans/[email protected] | ||
if: github.event_name == 'issue_comment' | ||
with: | ||
|
@@ -98,30 +98,32 @@ runs: | |
core.setOutput('has_signed', has_signed); | ||
core.debug(`has_signed: ${has_signed}`); | ||
|
||
# add [cla-signed] label if actor has already signed | ||
- name: Add label | ||
# if contributor has already signed, add [cla-signed] label | ||
- name: Add label to PR | ||
uses: actions-ecosystem/[email protected] | ||
if: steps.metadata.outputs.has_signed == 'true' && steps.metadata.outputs.has_label == 'false' | ||
with: | ||
github_token: ${{ inputs.token }} | ||
labels: ${{ inputs.label }} | ||
|
||
# remove [cla-signed] label if actor has not signed yet | ||
- name: Remove label | ||
# if contributor has not signed yet, remove [cla-signed] label | ||
- name: Remove label to PR | ||
uses: actions-ecosystem/[email protected] | ||
if: steps.metadata.outputs.has_signed == 'false' && steps.metadata.outputs.has_label == 'true' | ||
with: | ||
github_token: ${{ inputs.token }} | ||
labels: ${{ inputs.label }} | ||
|
||
# checkout cla_repo to update cla_path | ||
- uses: actions/checkout@v3 | ||
# if unsigned, checkout cla_repo | ||
- name: Clone CLA singee repo | ||
uses: actions/checkout@v3 | ||
if: steps.metadata.outputs.has_signed == 'false' | ||
with: | ||
repository: ${{ inputs.cla_repo }} | ||
|
||
# update cla_path | ||
- shell: python | ||
# if unsigned, update cla_path | ||
- name: Add contributor as a CLA signee | ||
shell: python | ||
if: steps.metadata.outputs.has_signed == 'false' | ||
run: | | ||
import json | ||
|
@@ -133,8 +135,9 @@ runs: | |
signees["contributors"].sort() | ||
path.write_text(json.dumps(signees, indent=2)) | ||
|
||
# create PR | ||
- uses: peter-evans/create-pull-request@v4 | ||
# if unsigned, create PR | ||
- name: Create PR with new CLA signee | ||
uses: peter-evans/create-pull-request@v4 | ||
id: pull | ||
if: steps.metadata.outputs.has_signed == 'false' | ||
with: | ||
|
@@ -151,8 +154,8 @@ runs: | |
|
||
Xref ${{ steps.metadata.outputs.url }} | ||
|
||
# create sticky comment if not signed | ||
- name: Create comment | ||
# if unsigned, create sticky comment | ||
- name: Create comment regarding missing CLA signature | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: steps.metadata.outputs.has_signed == 'false' | ||
with: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we add this to a separate javascript file? This is started to get long enough to warrant that, imo.
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.
Specifying these JS blocks in separate files requires:
My problem with this is the checkout step which will make it harder to version our actions.
There's an open request for something better: actions/github-script#326
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.
It's a common pattern for actions to include all JS inlined, even if it's not great, let's follow that for now