Skip to content

Commit

Permalink
fixup! build: add GitHub Action to update tools modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Nov 3, 2021
1 parent b86f829 commit 82c2751
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,32 @@ jobs:
matrix:
include:
- id: eslint
run: tools/update-eslint.sh
- id: babel-eslint
run: tools/update-babel-eslint.sh
- id: lint-md
run: |
(cd tools/lint-md && rm -rf package-lock.json node_modules && npm install --ignore-scripts)
make lint-md-rollup
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 --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 }}
Expand All @@ -30,8 +49,8 @@ jobs:
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 }} and/or its dependencies."
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 }} and/or its dependencies"
commit-message: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"
labels: tools
title: "tools: update ${{ matrix.id }} and/or its dependencies"
title: "tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}"

0 comments on commit 82c2751

Please sign in to comment.