-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EXUI-1108: Update to yarn v4.5.0 (#1782)
* Update to yarn v4.5.0 * add yarn 4.5.0.cjs * Manually remove line from known issues to check that script exits when difference is detected * update yarn audit, add pretty print to sh comparison file * Update version number * Update audit csript * remove unused file * update yarn audit * Update to release version number
- Loading branch information
1 parent
b9e29d3
commit b7abf6a
Showing
11 changed files
with
10,183 additions
and
10,094 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,28 @@ | ||
#!/usr/bin/env bash | ||
set +e | ||
yarn audit | ||
result=$? | ||
set -e | ||
#!/bin/bash | ||
|
||
if [[ "$result" != 0 ]]; then | ||
if [[ -f yarn-audit-known-issues ]]; then | ||
set +e | ||
yarn audit --json | grep auditAdvisory > yarn-audit-issues | ||
set -e | ||
new_vulnerabilities=false | ||
while read -r line; do | ||
url=$(node -pe 'JSON.parse(process.argv[1]).data.advisory.url' "$line") | ||
if ! grep -q "$url" yarn-audit-known-issues; then | ||
echo "unknown vulnerability:$url" | ||
new_vulnerabilities=true | ||
fi | ||
done < yarn-audit-issues | ||
upToDateVulnerabilities=$(mktemp) | ||
vulnerabilitiesInRepo="./yarn-audit-known-issues" | ||
|
||
if [[ "$new_vulnerabilities" = true ]] ; then | ||
echo | ||
echo Security vulnerabilities were found that were not ignored | ||
echo | ||
echo Check to see if these vulnerabilities apply to production | ||
echo and/or if they have fixes available. If they do not have | ||
echo fixes and they do not apply to production, you may ignore them | ||
echo | ||
echo To ignore these vulnerabilities, please add advisories urls | ||
echo "to yarn-audit-known-issues (eg: https://npmjs.com/advisories/755)" | ||
echo | ||
echo and commit the yarn-audit-known-issues file. | ||
yarn npm audit --recursive --environment production --json > "$upToDateVulnerabilities" | ||
|
||
exit "$result" | ||
fi | ||
# Ensure both files exist | ||
if [[ ! -f "$upToDateVulnerabilities" || ! -f "$vulnerabilitiesInRepo" ]]; then | ||
echo "Error: One or both required files do not exist." | ||
rm -f "$upToDateVulnerabilities" | ||
exit 1 | ||
fi | ||
|
||
fi | ||
# Compare the files and act based on the result | ||
if diff_output=$(diff "$upToDateVulnerabilities" "$vulnerabilitiesInRepo"); then | ||
echo "No differences found in vulnerabilities." | ||
else | ||
echo | ||
echo "Security vulnerability differences were found" | ||
echo | ||
echo "To ignore these vulnerabilities, run:" | ||
echo 'yarn npm audit --recursive --environment production --json > yarn-audit-known-issues' | ||
echo | ||
exit 1 | ||
fi | ||
|
||
rm -f "$upToDateVulnerabilities" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.