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
## What's the problem this PR addresses?
The `enableScripts` flag doesn't affect `git:` dependencies, which
always runs the `pack` script for whatever package manager the project
is using.
## How did you fix it?
To avoid running arbitrary code through the `git:` protocol we're
introducing a new setting called `approvedGitRepositories`. This list of
glob will validate the repository urls we clone.
## Checklist
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
Git dependencies are restricted through the `approvedGitRepositories` setting. GitHub repositories must match at least one of its glob patterns, otherwise Yarn will refuse to fetch them.
Copy file name to clipboardExpand all lines: packages/docusaurus/static/configuration/yarnrc.json
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,17 @@
71
71
"type": "number",
72
72
"default": 2
73
73
},
74
+
"approvedGitRepositories": {
75
+
"_package": "@yarnpkg/plugin-git",
76
+
"title": "Array of git repository URL glob patterns that are allowed to be fetched.",
77
+
"description": "When set, Yarn will block any git dependency whose normalized repository URL doesn't match one of these patterns. GitHub repositories must be explicitly approved.",
0 commit comments