Fix CodeQL issues for checked-in yarn binaries #1017
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR removes unnecessary
.yarn
folders from the repo and prevents them from being checked-in / scanned by CodeQL in the future.Why
Having yarn binaries checked-in is a security risk and CodeQL complains about issues in the scripts (which we can't fix, or even see, as they're obfuscated as binary files).
Removing the
.yarn
folder for older samples is not a problem, but newer samples which use Yarn 3, such asNativeModuleSample/cpp-lib
, need the Yarn 3 binaries checked-in.Unfortunately there's no way to get around this. Yarn refuses to acknowledge this anti-pattern and security issue (see yarnpkg/yarn#7741) and the "solution" to require users to install Yarn 3 via
corepack
does not work in GitHub CI (see actions/setup-node#480). I've tried every workaround combination in these two issues and none work.Closes #1016
Screenshots
N/A
Microsoft Reviewers: Open in CodeFlow