chore(deps): update actions/setup-node action to v4.1.0 #17525
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node license check | |
on: pull_request | |
env: | |
ALLOWED_LICENSES: > | |
MIT; | |
BSD; | |
ISC; | |
Apache-2.0; | |
MPL-2.0; | |
LGPL-3.0; | |
LGPL-3.0-or-later; | |
CC0-1.0; | |
CC-BY-3.0; | |
CC-BY-4.0; | |
Python-2.0; | |
PSF; | |
Public Domain; | |
WTFPL; | |
Unlicense; | |
BlueOak-1.0.0; | |
# It has to be one line, there must be no space between packages. | |
EXCLUDE_PACKAGES: [email protected];[email protected];@cspell/[email protected]; | |
jobs: | |
generate-matrix: | |
name: Lists modules | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | |
- run: | | |
DIRS=$(find -not \( -path \*node_modules -prune \) -type f -name yarn.lock | xargs dirname | awk -v RS='' -v OFS='","' 'NF { $1 = $1; print "\"" $0 "\"" }') | |
echo "matrix=[${DIRS}]" >> $GITHUB_OUTPUT | |
id: set-matrix | |
license-check: | |
needs: [generate-matrix] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dir: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
steps: | |
- name: Checkout latest code | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | |
- name: Use Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: 18 | |
- name: Install yarn | |
run: npm install -g yarn license-checker | |
- name: Install dependencies in ${{ matrix.dir }} | |
working-directory: ${{ matrix.dir }} | |
run: yarn install | |
- name: Check licenses in ${{ matrix.dir }} | |
working-directory: ${{ matrix.dir }} | |
run: npx license-checker --json --onlyAllow="$ALLOWED_LICENSES" --excludePackages "$EXCLUDE_PACKAGES" --excludePrivatePackages |