Skip to content

ci(workflows): add system-file-changes workflow#26853

Merged
caugner merged 10 commits intomainfrom
system-file-changes
May 23, 2025
Merged

ci(workflows): add system-file-changes workflow#26853
caugner merged 10 commits intomainfrom
system-file-changes

Conversation

@caugner
Copy link
Copy Markdown
Contributor

@caugner caugner commented May 20, 2025

Summary

Adds new system-file-changes workflow that fails when anyone who isn't an admin
or a BCD owner changes any file that isn't BCD JSON data or Markdown docs.

Prevents accidental or malicious changes, and ensures that these get noticed.

This is more relevant now with the PR Review Companion, which could lead to
reviewers no longer checking all changes on the "Files changed" tabs, especially
if the list of changes or changed files is long, and doesn't fit on the screen.

Test results and supporting details

Related issues

@github-actions github-actions bot added infra Infrastructure issues (npm, GitHub Actions, releases) of this project size:m [PR only] 25-100 LoC changed labels May 20, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 20, 2025

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@caugner caugner force-pushed the system-file-changes branch from 33b4852 to 1d611f7 Compare May 20, 2025 15:09
@github-actions github-actions bot added the docs Issues or pull requests regarding the documentation of this project. label May 20, 2025
@github-actions github-actions bot added schema Isses or pull requests regarding the JSON schema files used in this project. data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML data:svg Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG data:webdriver Compat data for WebDriver features. https://developer.mozilla.org/docs/Web/WebDriver data:mathml Compat data for MathML features. https://developer.mozilla.org/docs/Web/MathML data:wasm Compat data for Web Assembly features. https://developer.mozilla.org/en-US/docs/WebAssembly data:manifests size:xl [PR only] >1000 LoC changed and removed size:m [PR only] 25-100 LoC changed labels May 20, 2025
@github-actions github-actions bot removed schema Isses or pull requests regarding the JSON schema files used in this project. data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP labels May 20, 2025
@github-actions github-actions bot added size:m [PR only] 25-100 LoC changed and removed data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS docs Issues or pull requests regarding the documentation of this project. data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML data:svg Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG data:webdriver Compat data for WebDriver features. https://developer.mozilla.org/docs/Web/WebDriver data:mathml Compat data for MathML features. https://developer.mozilla.org/docs/Web/MathML data:wasm Compat data for Web Assembly features. https://developer.mozilla.org/en-US/docs/WebAssembly data:manifests size:xl [PR only] >1000 LoC changed labels May 20, 2025
@caugner caugner marked this pull request as ready for review May 20, 2025 15:29
@caugner caugner requested review from Elchi3 and queengooborg May 20, 2025 15:36
Copy link
Copy Markdown
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

I see the paths list contains an allow list. I guess this will mean that we will have to remember to add new folders to this file. Probably more safe than having to remember to add new system files to this check. So, I think this makes sense.

(In content this seems to be the other way around, you have to provide files/folders to block, see https://github.com/mdn/content/blob/main/.github/workflows/system-file-changes.yml)

@caugner
Copy link
Copy Markdown
Contributor Author

caugner commented May 23, 2025

I see the paths list contains an allow list. I guess this will mean that we will have to remember to add new folders to this file. Probably more safe than having to remember to add new system files to this check. So, I think this makes sense.

(In content this seems to be the other way around, you have to provide files/folders to block, see https://github.com/mdn/content/blob/main/.github/workflows/system-file-changes.yml)

Yes, I figured it's safer to use an allow list. Although we might want to update the approach for the content repos as well, it is slightly less critical, as we don't publish any artifact (like an npm package) from the content repo.

@caugner caugner merged commit 12b5633 into main May 23, 2025
11 checks passed
@caugner caugner deleted the system-file-changes branch May 23, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Infrastructure issues (npm, GitHub Actions, releases) of this project size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants