Workflow to handle misdirected submissions#157
Conversation
It's almost 100 lines and has a maintenance burden, it doesn't seem that simple ... |
| const curriculumCrewTeamSlug = process.env.CURRICULUM_CREW_TEAM_SLUG; | ||
|
|
||
| try { | ||
| await github.rest.teams.getMembershipForUserInOrg({ |
There was a problem hiding this comment.
I can't remember exactly, but i tried something like this check on my own version and i had a permission issue, because a trainee submitting it from a fork doesn't by default have permissions to check our org for team ownership. I think we could open this permission for this check, but I was seeing if there was a way to avoid that at first.
Granted, i'm new to actions and still learning, maybe i misunderstood something in my own test.
There was a problem hiding this comment.
I was assuming that trainees permissions would not matter- the workflow runs on repository level permissions. But now that you are questioning it, I am also doubting. I trust your experience would be correct as I am sharing an idea (which is maybe redundant) and not a tested process.
Either way, this is just a conceptual draft to showcase what I was thinking, as I felt I should follow up with the discussion that I abandoned a bit. Let's just forget about it!
Relates to #152
logic:
step
#1: checks if the PR author is in one of the predefined trainee teamsstep
#2: checks if the PR author is in 'curriculum-crew' teamstep
#3: if step 1 puts outtrueand step 2 puts outfalse, PR is commented and closed**If the PR author is in a trainee team and is NOT in the curriculum crew team, it means that it is a trainee making a misdirected submission (safe to assume). In that case, the PR gets commented on and closed. Comment TBD.
👷🏽 Maintenance: