-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
Any PR with "dangerous" edits should be considered dangerous #2985
Comments
We'll need to assume that when |
@nschonni Do you have some ideas for implementation here? I was thinking something like this: name: Markdown Docs files
on:
pull_request:
paths:
- scripts/*
- package.json
- yarn.lock
- .github/workflows/*
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Stop anything
run: |
echo "Any PR that edits these files should break the build and expect admin overrides"
exit 1 Do you have any good suggestions for checking if it's coming from a fork or not? (...to solve the problem of letting |
Would it be an option to write a workflow |
We have to remember to do the same with |
GitHub does something like this for their docs in https://github.com/github/docs/blob/main/.github/workflows/triage-unallowed-contributions.yml but I'm not sure I always like that approach (stopped contributing their since they just auto-close CI related PRs 😝 ) I'm not sure if there is anything else needed to make it "enforce" the values you've already set in the CODEOWNERS
Think there are some examples of that in the GitHub/docs jobs too |
@nschonni Auto-closing PRs seems a bit draconian. There are many pieces I don't quite understand what that does. |
* Any PR with "dangerous" edits should be considered dangerous Fixes #2985 * try again * no need for it being a pull_request_target * only on mdn/content * repository_owner * repository_owner * dbg * must be pull_request_target * comment out * more small edits * rename
Oops. #3200 does not fix this issue yet. |
This is "in production" now. |
Security scenario: Someone makes a PR that covers lots and lots of files. They might all look like harmless typo fixes in various
index.html
files. But they could also try to sneak in a change to.github/workflows/pr-testing.yml
that disables something in the workflow that checks for unsafe things. For example:Another example is that they might mess with
yarn.lock
so that it changes something like this:If this happens, the reviewer should be as helped as possible to avoid missing this. Probably safest to just break the build so that only an admin can merge it. The hope and assumption is that seeing the red X on the checks should alert even the admins to not be too quick to merge.
The text was updated successfully, but these errors were encountered: