Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-10-29 03:33:29 +0300
committerRich Trott <rtrott@gmail.com>2021-11-08 22:47:51 +0300
commite8d16eee26a785952f23a8b20e08e122d9b0aacb (patch)
tree250057fb2ce8b963a1a1ec8cadfc48d485993e1b /.github
parentdf2fe87c69455da3d1516f3eccdea001c06af583 (diff)
build: add GitHub Action to update tools modules
Update ESLint, Babel, remark, and so on. Run once a week. PR-URL: https://github.com/nodejs/node/pull/40644 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/tools.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml
new file mode 100644
index 00000000000..9924ebf6e68
--- /dev/null
+++ b/.github/workflows/tools.yml
@@ -0,0 +1,56 @@
+name: "tools update"
+on:
+ schedule:
+ # Run once a week at 00:05 AM UTC on Saturday.
+ - cron: '5 0 * * 6'
+
+ workflow_dispatch:
+
+jobs:
+ tools_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
+ run: |
+ cd tools
+ NEW_VERSION=$(npm view eslint dist-tags.latest)
+ CURRENT_VERSION=$(node -p "require('./node_modules/eslint/package.json').version")
+ if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
+ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
+ tools/update-eslint.sh
+ fi
+ - id: "@babel/eslint-parser"
+ run: |
+ cd tools
+ NEW_VERSION=$(npm view @babel/eslint-parser dist-tags.latest)
+ CURRENT_VERSION=$(node -p "require('./node_modules/@babel/eslint-parser/package.json').version")
+ if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
+ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
+ tools/update-babel-eslint.sh
+ fi
+ - id: "lint-md dependencies"
+ run: |
+ cd tools/lint-md
+ NEW_VERSION=$(npm outdated --omit=dev --parseable | cut -d: -f4 | xargs)
+ if [ "$NEW_VERSION" != "" ]; then
+ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
+ rm -rf package-lock.json node_modules && npm install --ignore-scripts)
+ make lint-md-rollup
+ fi
+ steps:
+ - uses: actions/checkout@v2
+ - run: ${{ matrix.run }}
+ - uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR
+ 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: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
+ labels: tools
+ title: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"