mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
PR-URL: https://github.com/nodejs/node/pull/47205 Refs: https://github.com/nodejs/security-wg/issues/828 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Adrian Estrada <edsadr@gmail.com>
189 lines
7.4 KiB
YAML
189 lines
7.4 KiB
YAML
name: Tools and deps update
|
|
on:
|
|
schedule:
|
|
# Run once a week at 00:05 AM UTC on Sunday.
|
|
- cron: 5 0 * * 0
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
tools-deps-update:
|
|
if: github.repository == 'nodejs/node'
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false # Prevent other jobs from aborting if one fails
|
|
matrix:
|
|
include:
|
|
- id: eslint
|
|
subsystem: tools
|
|
label: tools
|
|
run: |
|
|
./tools/dep_updaters/update-eslint.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: corepack
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
make corepack-update
|
|
echo "NEW_VERSION=$(node deps/corepack/dist/corepack.js --version)" >> $GITHUB_ENV
|
|
- id: lint-md-dependencies
|
|
subsystem: tools
|
|
label: tools
|
|
run: |
|
|
cd tools/lint-md
|
|
npm ci
|
|
NEW_VERSION=$(npm outdated --parseable | cut -d: -f4 | xargs)
|
|
if [ "$NEW_VERSION" != "" ]; then
|
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
|
rm -rf package-lock.json node_modules
|
|
# Include $NEW_VERSION to explicitly update the package.json
|
|
# entry for the dependency and also so that semver-major updates
|
|
# are not skipped.
|
|
npm install --ignore-scripts $NEW_VERSION
|
|
npm install --ignore-scripts
|
|
cd ../..
|
|
make lint-md-rollup
|
|
fi
|
|
- id: doc
|
|
subsystem: tools
|
|
label: tools
|
|
run: |
|
|
cd tools/doc
|
|
npm ci
|
|
NEW_VERSION=$(npm outdated --parseable | cut -d: -f4 | xargs)
|
|
if [ "$NEW_VERSION" != "" ]; then
|
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
|
rm -rf package-lock.json node_modules
|
|
# Include $NEW_VERSION to explicitly update the package.json
|
|
# entry for the dependency and also so that semver-major updates
|
|
# are not skipped.
|
|
npm install --ignore-scripts $NEW_VERSION
|
|
npm install --ignore-scripts
|
|
fi
|
|
- id: undici
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
NEW_VERSION=$(npm view undici dist-tags.latest)
|
|
CURRENT_VERSION=$(node -p "require('./deps/undici/src/package.json').version")
|
|
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
|
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
|
./tools/update-undici.sh
|
|
fi
|
|
- id: postject
|
|
subsystem: deps,test
|
|
label: test
|
|
run: |
|
|
./tools/dep_updaters/update-postject.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: base64
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-base64.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: acorn
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
NEW_VERSION=$(npm view acorn dist-tags.latest)
|
|
CURRENT_VERSION=$(node -p "require('./deps/acorn/acorn/package.json').version")
|
|
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
|
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
|
./tools/update-acorn.sh
|
|
fi
|
|
- id: acorn-walk
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
NEW_VERSION=$(npm view acorn-walk dist-tags.latest)
|
|
CURRENT_VERSION=$(node -p "require('./deps/acorn/acorn-walk/package.json').version")
|
|
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
|
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
|
./tools/update-acorn-walk.sh
|
|
fi
|
|
- id: libuv
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-libuv.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: simdutf
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-simdutf.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: ada
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-ada.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: nghttp2
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-nghttp2.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: llhttp
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-llhttp.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: c-ares
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-c-ares.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
- id: brotli
|
|
subsystem: deps
|
|
label: dependencies
|
|
run: |
|
|
./tools/dep_updaters/update-brotli.sh > temp-output
|
|
cat temp-output
|
|
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
|
|
rm temp-output
|
|
steps:
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
|
with:
|
|
persist-credentials: false
|
|
- run: ${{ matrix.run }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
|
- uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5
|
|
# Creates a PR or update the Action's existing PR, or
|
|
# no-op if the base branch is already up-to-date.
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
|
|
with:
|
|
author: Node.js GitHub Bot <github-bot@iojs.org>
|
|
body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}.
|
|
branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action.
|
|
commit-message: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'
|
|
labels: ${{ matrix.label }}
|
|
title: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}'
|