You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI Define GHA policies so that we can use pull_request_target after December 9 (ideally before November 9 so we can test it during the first brownout) #35103
This issue is not yet ready for a PR. If you are interested in contributing to scikit-learn, please have a look at our contributing guidelines, and in particular the sections for new contributors and the "Needs triage" label.
I think the workflows we have right now need to use pull_request_target and we are fairly sure that we are "doing it right" (famous last words). So I'd add a policy to allow them.
My crude understanding was to use the policies settings page and then manage to figure out how to configure it to allow pull_request_target for the following workflows (based on a quick git grep):
It seems like we can't see anything on the insights page :-/ I was hoping to see something now already and then use the "audit" mode to check that we got all workflows and that our policy is set to allow them.
Maybe what we should do instead is try and configure a policy to allow things and then see what happens? Many of the workflows we can trigger by doing something in the repo, so it would be possible to explicitly test them
My naive firsts attempt would have been something like this:
a policy to allow everything but pull_request_target for all workflows
a policy to allow pull_request_target only for the listed workflow above.
Testing this in a separate repo is maybe a good idea, mostly because with CI, it's easy to get things slightly wrong and you generally need to iterate a few times. I have realized recently, that agents are quite good at creating test repo and testing CI setups 😉.
If that works, a potential follow-up is to investigate whether pull_request_target is the only one that is problematic. The Astral security blog post says they also forbid workflow_run, which we use for the linting bot comment.
Good news, looks like this change has been postponed see blog post.
There are two brownout schedules, one of them is next Monday (Monday November 9) so it would be good to have something in place to test it by next Monday for real (seems like this is the simplest way to test it):
Date Time (UTC)
November 9, 2026 16:00–18:00
November 16, 2026 16:00–18:00
changed the title [-]CI Define GHA policies so that we can use `pull_request_target` after November 2[/-][+]CI Define GHA policies so that we can use `pull_request_target` after November 9[/+]on Nov 3, 2026
changed the title [-]CI Define GHA policies so that we can use `pull_request_target` after November 9[/-][+]CI Define GHA policies so that we can use `pull_request_target` after December 9 (ideally before November 9 so we can test it during the brownout)[/+]on Nov 3, 2026
changed the title [-]CI Define GHA policies so that we can use `pull_request_target` after December 9 (ideally before November 9 so we can test it during the brownout)[/-][+]CI Define GHA policies so that we can use `pull_request_target` after December 9 (ideally before November 9 so we can test it during the first brownout)[/+]on Nov 3, 2026
I've created a policy that allows event triggers including pull_request_target for the workflows you listed (minus the python script that grep found).
The default list of allowed events to trigger the workflow is very long. I think we can cut it down to just the triggers we use for these workflows. In practice I think this means removing all events except pull_request_target.
I will wait a bit before adding a policy that forbids pull_request_target. Maybe until after the brownout?
I feel that this is a rabbit hole. I mean, what is it trying to tell me with "can't be converted, should we import them"? Makes me think I should be migrating ?? Something for a new issue maybe.
Nice thanks a lot! I also added .github/workflows/pr-size-labeler.yml which was added in the meantime.
This seems like a good first step.
I think it's OK to look at the Insights page in a couple of days or look and at the end of the day on November 9 once the brownout is over to make sure there are no
Maybe I am missing something, but I don't find the Insights page super useful (to put it nicely 😅), there is no way to know which workflow is blocked ...
I saw the three dots but the additional info is not very useful "some rules did not pass", which ones GitHub which ones, tell me 🔮?
Anyway I think we are on the right track to be safe when pull_request_target is disabled by default 💪 🤞.
Related to one of your previous point: no GitHub, now is not the right time to nudge me into converting/importing my branch protection settings into rulesets whatever they are, I couldn't possibly care less about this kind of things right now 😜.
I can't find it again either, but I was 95% sure I had found a way to see the name of the workflow. After a lot of random clicking.
The good news is that the insights page hasn't had a new entry for about 19hours. My guess is that the new rules that allow pull_request_target are taking effect and hence we don't see "would be blocked" anymore.
The good news is that the insights page hasn't had a new entry for about 19hours. My guess is that the new rules that allow pull_request_target are taking effect and hence we don't see "would be blocked" anymore.
Activity
betatim commentedon Oct 9, 2026
From reading the docs page I originally linked I was expecting to see something on https://github.com/scikit-learn/scikit-learn/settings/actions/rules/insights because they say they are running this new policy in evaluate mode. However, nothing shows up. Just a "to use this upgrade to enterprise" :-/
lesteve commentedon Oct 10, 2026
My crude understanding was to use the policies settings page and then manage to figure out how to configure it to allow
pull_request_targetfor the following workflows (based on a quickgit grep):Edit: just saw @betatim has asked in https://github.com/community/maintainers/discussions/907 👀.
betatim commentedon Oct 12, 2026
It seems like we can't see anything on the insights page :-/ I was hoping to see something now already and then use the "audit" mode to check that we got all workflows and that our policy is set to allow them.
Maybe what we should do instead is try and configure a policy to allow things and then see what happens? Many of the workflows we can trigger by doing something in the repo, so it would be possible to explicitly test them
lesteve commentedon Oct 12, 2026
My naive firsts attempt would have been something like this:
pull_request_targetfor all workflowspull_request_targetonly for the listed workflow above.Testing this in a separate repo is maybe a good idea, mostly because with CI, it's easy to get things slightly wrong and you generally need to iterate a few times. I have realized recently, that agents are quite good at creating test repo and testing CI setups 😉.
If that works, a potential follow-up is to investigate whether
pull_request_targetis the only one that is problematic. The Astral security blog post says they also forbidworkflow_run, which we use for the linting bot comment.lesteve commentedon Nov 3, 2026
Good news, looks like this change has been postponed see blog post.
There are two brownout schedules, one of them is next Monday (Monday November 9) so it would be good to have something in place to test it by next Monday for real (seems like this is the simplest way to test it):
@betatim do you want to do it 😉?
[-]CI Define GHA policies so that we can use `pull_request_target` after November 2[/-][+]CI Define GHA policies so that we can use `pull_request_target` after November 9[/+][-]CI Define GHA policies so that we can use `pull_request_target` after November 9[/-][+]CI Define GHA policies so that we can use `pull_request_target` after December 9 (ideally before November 9 so we can test it during the brownout)[/+][-]CI Define GHA policies so that we can use `pull_request_target` after December 9 (ideally before November 9 so we can test it during the brownout)[/-][+]CI Define GHA policies so that we can use `pull_request_target` after December 9 (ideally before November 9 so we can test it during the first brownout)[/+]betatim commentedon Nov 3, 2026
I've created a policy that allows event triggers including
pull_request_targetfor the workflows you listed (minus the python script that grep found).The default list of allowed events to trigger the workflow is very long. I think we can cut it down to just the triggers we use for these workflows. In practice I think this means removing all events except
pull_request_target.https://github.com/scikit-learn/scikit-learn/settings/actions/rules/insights this now works and shows us that several of the workflows would be blocked. I think with the new policy active we should no longer see things appear there, or they should be listed as allowed instead of "would be blocked" (which is what they are now).
I will wait a bit before adding a policy that forbids
pull_request_target. Maybe until after the brownout?I feel that this is a rabbit hole. I mean, what is it trying to tell me with "can't be converted, should we import them"? Makes me think I should be migrating ?? Something for a new issue maybe.

(screenshot is from the policies page)
lesteve commentedon Nov 3, 2026
Nice thanks a lot! I also added
.github/workflows/pr-size-labeler.ymlwhich was added in the meantime.This seems like a good first step.
I think it's OK to look at the Insights page in a couple of days or look and at the end of the day on November 9 once the brownout is over to make sure there are no
Maybe I am missing something, but I don't find the Insights page super useful (to put it nicely 😅), there is no way to know which workflow is blocked ...
betatim commentedon Nov 3, 2026
Yeah, the insights page is a bit thin. I think you can click the "three dots" icon to get a bit more detail.
Thanks for the extra workflow
lesteve commentedon Nov 3, 2026
I saw the three dots but the additional info is not very useful "some rules did not pass", which ones GitHub which ones, tell me 🔮?
Anyway I think we are on the right track to be safe when
pull_request_targetis disabled by default 💪 🤞.Related to one of your previous point: no GitHub, now is not the right time to nudge me into converting/importing my branch protection settings into rulesets whatever they are, I couldn't possibly care less about this kind of things right now 😜.
betatim commentedon Nov 4, 2026
I can't find it again either, but I was 95% sure I had found a way to see the name of the workflow. After a lot of random clicking.
The good news is that the insights page hasn't had a new entry for about 19hours. My guess is that the new rules that allow
pull_request_targetare taking effect and hence we don't see "would be blocked" anymore.lesteve commentedon Nov 4, 2026
Yup agreed.
lesteve commentedon Nov 10, 2026
Seems like there was no
pull_request_targetfailures during the November 9 brownout https://github.com/scikit-learn/scikit-learn/actions?query=event%3Apull_request_target+is%3Afailure, so this is a confirmation that we should be fine I think.Note to our future selves, if we had a workflow with
pull_request_target(or rename one) we need to remember to add it to this settings pagebetatim commentedon Nov 10, 2026
Let's close this then. If we find that it is broken after all we can reopen this