gha: gate CI on org membership or ok-to-test label - #177
Conversation
42c5d30 to
0fa4b59
Compare
Execute the CI if the author is an org member or if the PR is labeled with the ok-to-test if we trust the author of the PR. Assisted-by: AI Signed-off-by: Alice Frosi <afrosi@redhat.com>
0fa4b59 to
339644e
Compare
HarshwardhanPatil07
left a comment
There was a problem hiding this comment.
is this because we are going to use konflux? i don't see this pattern in bootc
|
@HarshwardhanPatil07 no it is because I don't want always to manually approve the CI run for no-members. Like for example: #168 . We can discuss this on Monday. But it is a common label used by other orgs |
|
@Johan-Liebert1 do you know how the other repositories in bootc-dev org approve the CI run for PRs from no-org members? |
|
they just run for every pr :) and if we want full test suite to be ran we run it through ci/merge i guess |
|
i saw it when i was no-org mem |
|
@Johan-Liebert1 can you confirm? |
|
Hmm.. I don't remember ever approving workflows to run on bootc particularly (I might be wrong here though). I do remember permitting CI to run for bootupd (again, maybe). I don't remember which repo it was where I had to manually approve CI to run if PR wasn't opened by a non-member of the org. |
|
let's merge this, we can always revert it if we found a better way |
|
This won't work as is, here's a quick result of a chat with Copilot, key bit is:
Details**No—not as written.** There are two separate issues:
With the setting “Require approval for first-time contributors”, GitHub will automatically run workflows for:
But a genuinely new external contributor’s workflow will remain awaiting approval, regardless of whether the PR has an So the workflow can gate jobs after GitHub has started the workflow, but it cannot replace GitHub’s approval mechanism. Also, because the workflow listens for At minimum, fix the path: jobs:
check-permissions:
uses: ./.github/workflows/check-permissions.ymlIf the goal is “new external PRs run only after a maintainer marks them trusted,” the reliable design is usually:
Be especially cautious with |
Execute the CI if the author is an org member or if the PR is labeled with the ok-to-test if we trust the author of the PR.