forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: add automation for updating base64 dependency
Add a Github Action that checks for new versions of the `base64` C library, and creates a PR to update it if a newer version than the one present in the repo is found. Refs: nodejs/security-wg#828 PR-URL: nodejs#45300 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
- Loading branch information
1 parent
c3e9a48
commit 1e80812
Showing
2 changed files
with
56 additions
and
0 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 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh | ||
set -e | ||
# Shell script to update base64 in the source tree to a specific version | ||
|
||
BASE_DIR=$(cd "$(dirname "$0")/.." && pwd) | ||
DEPS_DIR="$BASE_DIR/deps" | ||
BASE64_VERSION=$1 | ||
|
||
if [ "$#" -le 0 ]; then | ||
echo "Error: please provide an base64 version to update to" | ||
echo " e.g. $0 0.4.0" | ||
exit 1 | ||
fi | ||
|
||
echo "Making temporary workspace" | ||
|
||
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') | ||
|
||
cleanup () { | ||
EXIT_CODE=$? | ||
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE" | ||
exit $EXIT_CODE | ||
} | ||
|
||
trap cleanup INT TERM EXIT | ||
|
||
cd "$WORKSPACE" | ||
|
||
echo "Fetching base64 source archive" | ||
curl -sL "https://api.github.com/repos/aklomp/base64/tarball/v$BASE64_VERSION" | tar xzf - | ||
mv aklomp-base64-* base64 | ||
|
||
echo "Replacing existing base64" | ||
rm -rf "$DEPS_DIR/base64/base64" | ||
mv "$WORKSPACE/base64" "$DEPS_DIR/base64/" | ||
|
||
echo "All done!" | ||
echo "" | ||
echo "Please git add base64/base64, commit the new version:" | ||
echo "" | ||
echo "$ git add -A deps/base64/base64" | ||
echo "$ git commit -m \"deps: update base64 to $BASE64_VERSION\"" | ||
echo "" |