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

Add label to prs that need a CLA signed #12354

Merged
merged 9 commits into from
Dec 9, 2024
Merged

Add label to prs that need a CLA signed #12354

merged 9 commits into from
Dec 9, 2024

Conversation

jjspace
Copy link
Contributor

@jjspace jjspace commented Dec 2, 2024

Description

The label is helpful when viewing PRs in other Github views. I've been doing this manually to a few PRs but it should be easily automatable

Issue number and link

no issue

Testing plan

Was a label added to this pr when it was not a conditional check? Then we're good

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

github-actions bot commented Dec 2, 2024

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

1 similar comment
Copy link

github-actions bot commented Dec 2, 2024

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

Copy link

github-actions bot commented Dec 2, 2024

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

Copy link

github-actions bot commented Dec 2, 2024

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

@jjspace
Copy link
Contributor Author

jjspace commented Dec 2, 2024

@siddheshranade I recall you did the initial implementation of the CLA check, any ideas why this is not working? Do re-runs of the workflow pull from the latest version of the script on this branch or from main?

@siddheshranade
Copy link
Contributor

@jjspace I remember facing the same issue. Yes, manual re-runs of the workflow will execute the code in main.

A workaround I remember using was to update cla.yaml to trigger the action on a push instead of pull_request_target:

on:
  push:

This way you don't have to manually re-run the workflow, it triggers on every git push, and executes the code on whichever branch you're pushing to. You can reset this YAML file change once you confirm the label is being set.

Correct me in case I'm wrong about this and I'm happy to look into it more deeply.

@jjspace jjspace requested a review from ggetz December 3, 2024 16:05
@jjspace
Copy link
Contributor Author

jjspace commented Dec 3, 2024

Testing this was annoying but I was able to confirm the route to add labels works and it added the correct one. Thanks for the suggestion to switch to push @siddheshranade, that was helpful but github fills in different environment variables for different events so it was still a pain...
I left the commit history to show how the working code changed but it could probably be condensed down into a single commit. Anyway, i'm done playing with this, if we want it it should work, if not i'll leave that up to @ggetz

@ggetz
Copy link
Contributor

ggetz commented Dec 9, 2024

Yes, workflows with pull_request_target do not run in the context of the branch for security reasons (as the granted GitHub token has write access). So that means this will not trigger in this or any PR until the code is merged into main.

TLDR; It's a pain to test for a reason.

Automating this label gets a 👍 from me.

@ggetz ggetz added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit 2647b90 Dec 9, 2024
8 of 9 checks passed
@ggetz ggetz deleted the cla-label branch December 9, 2024 19:27
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.

3 participants