Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eda4ae5

Browse filesBrowse files
facutuescaRafaelGSS
authored andcommitted
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: #45300 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 4d38bf2 commit eda4ae5
Copy full SHA for eda4ae5

File tree

Expand file treeCollapse file tree

2 files changed

+56
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+56
-0
lines changed
Open diff view settings
Collapse file

‎.github/workflows/tools.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/tools.yml
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,24 @@ jobs:
7878
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
7979
./tools/update-undici.sh
8080
fi
81+
- id: base64
82+
subsystem: deps
83+
label: dependencies
84+
run: |
85+
NEW_VERSION=$(gh api repos/aklomp/base64/releases/latest -q '.tag_name|ltrimstr("v")')
86+
CURRENT_VERSION=$(grep "base64 LANGUAGES C VERSION" ./deps/base64/base64/CMakeLists.txt | \
87+
sed -n "s/^.*VERSION \(.*\))/\1/p")
88+
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
89+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
90+
./tools/update-base64.sh "$NEW_VERSION"
91+
fi
8192
steps:
8293
- uses: actions/checkout@v3
8394
with:
8495
persist-credentials: false
8596
- run: ${{ matrix.run }}
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
8699
- uses: gr2m/create-or-update-pull-request-action@dc1726cbf4dd3ce766af4ec29cfb660e0125e8ee
87100
# Creates a PR or update the Action's existing PR, or
88101
# no-op if the base branch is already up-to-date.
Collapse file

‎tools/update-base64.sh‎

Copy file name to clipboard
+43Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
set -e
3+
# Shell script to update base64 in the source tree to a specific version
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/.." && pwd)
6+
DEPS_DIR="$BASE_DIR/deps"
7+
BASE64_VERSION=$1
8+
9+
if [ "$#" -le 0 ]; then
10+
echo "Error: please provide an base64 version to update to"
11+
echo " e.g. $0 0.4.0"
12+
exit 1
13+
fi
14+
15+
echo "Making temporary workspace"
16+
17+
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')
18+
19+
cleanup () {
20+
EXIT_CODE=$?
21+
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE"
22+
exit $EXIT_CODE
23+
}
24+
25+
trap cleanup INT TERM EXIT
26+
27+
cd "$WORKSPACE"
28+
29+
echo "Fetching base64 source archive"
30+
curl -sL "https://api.github.com/repos/aklomp/base64/tarball/v$BASE64_VERSION" | tar xzf -
31+
mv aklomp-base64-* base64
32+
33+
echo "Replacing existing base64"
34+
rm -rf "$DEPS_DIR/base64/base64"
35+
mv "$WORKSPACE/base64" "$DEPS_DIR/base64/"
36+
37+
echo "All done!"
38+
echo ""
39+
echo "Please git add base64/base64, commit the new version:"
40+
echo ""
41+
echo "$ git add -A deps/base64/base64"
42+
echo "$ git commit -m \"deps: update base64 to $BASE64_VERSION\""
43+
echo ""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.