diff options
author | Facundo Tuesca <facundo.tuesca@trailofbits.com> | 2022-11-21 18:18:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 18:18:35 +0000 |
commit | 59bb1981613332d8e66f4220c30aa5f0c6ab39c7 (patch) | |
tree | 4f204051e0f2e8e2a31eefb032bd5927b7fa050e /.github | |
parent | cf46746b8af4bd3fe9afc708e76ffd68f10b4785 (diff) | |
download | node-new-59bb1981613332d8e66f4220c30aa5f0c6ab39c7.tar.gz |
tools: add automation for updating libuv dependency
Add a Github Action that checks for new versions of the `libuv` C
library, and creates a PR to update it if a newer version than the one
present in the repo is found.
Refs: https://github.com/nodejs/security-wg/issues/828
PR-URL: https://github.com/nodejs/node/pull/45362
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/tools.yml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 2b371c93cd..8345785030 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -109,6 +109,22 @@ jobs: echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV ./tools/update-acorn-walk.sh fi + - id: libuv + subsystem: deps + label: dependencies + run: | + NEW_VERSION=$(gh api repos/libuv/libuv/releases/latest -q '.tag_name|ltrimstr("v")') + VERSION_H="./deps/uv/include/uv/version.h" + CURRENT_MAJOR_VERSION=$(grep "#define UV_VERSION_MAJOR" $VERSION_H | sed -n "s/^.*MAJOR \(.*\)/\1/p") + CURRENT_MINOR_VERSION=$(grep "#define UV_VERSION_MINOR" $VERSION_H | sed -n "s/^.*MINOR \(.*\)/\1/p") + CURRENT_PATCH_VERSION=$(grep "#define UV_VERSION_PATCH" $VERSION_H | sed -n "s/^.*PATCH \(.*\)/\1/p") + CURRENT_SUFFIX_VERSION=$(grep "#define UV_VERSION_SUFFIX" $VERSION_H | sed -n "s/^.*SUFFIX \"\(.*\)\"/\1/p") + SUFFIX_STRING=$([[ -z "$CURRENT_SUFFIX_VERSION" ]] && echo "" || echo "-$CURRENT_SUFFIX_VERSION") + CURRENT_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_PATCH_VERSION$SUFFIX_STRING" + if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + ./tools/dep_updaters/update-libuv.sh "$NEW_VERSION" + fi steps: - uses: actions/checkout@v3 with: |