Skip to content
  •  
  •  
  •  
161 changes: 161 additions & 0 deletions .github/workflows/check-npm-dependencies-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-npm-dependencies-task.md
name: Check npm Dependencies

# See: https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-npm-dependencies-task.ya?ml"
- ".licenses/**"
- ".licensed.json"
- ".licensed.ya?ml"
- ".npmrc"
- "Taskfile.ya?ml"
- "**/.gitmodules"
- "**/package.json"
- "**/package-lock.json"
pull_request:
paths:
- ".github/workflows/check-npm-dependencies-task.ya?ml"
- ".licenses/**"
- ".npmrc"
- ".licensed.json"
- ".licensed.ya?ml"
- "Taskfile.ya?ml"
- "**/.gitmodules"
- "**/package.json"
- "**/package-lock.json"
schedule:
# Run periodically to catch breakage caused by external changes.
- cron: "0 8 * * WED"
workflow_dispatch:
repository_dispatch:

jobs:
run-determination:
runs-on: ubuntu-latest
permissions: {}
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
- name: Determine if the rest of the workflow should run
id: determination
run: |
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
if [[
"${{ github.event_name }}" != "create" ||
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
]]; then
# Run the other jobs.
RESULT="true"
else
# There is no need to run the other jobs.
RESULT="false"
fi

echo "result=$RESULT" >>$GITHUB_OUTPUT

check-cache:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive

# This is required to allow licensee/setup-licensed to install licensed via Ruby gem.
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Install latest version

- name: Install licensed
uses: licensee/setup-licensed@v1.3.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 5.x

- name: Install Task
uses: go-task/setup-task@v1

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: package.json

- name: Install project dependencies
run: sudo apt update -y && sudo apt install -y libxkbfile-dev libsecret-1-dev

- name: Update dependencies license metadata cache
run: task --silent general:cache-dep-licenses

- name: Check for outdated cache
id: diff
run: |
git add .
if
! git diff \
--cached \
--color \
--exit-code
then
echo
echo "::error::Dependency license metadata out of sync. See: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md#metadata-cache"
exit 1
fi

# Some might find it convenient to have CI generate the cache rather than setting up for it locally
- name: Upload cache to workflow artifact
if: failure() && steps.diff.outcome == 'failure'
uses: actions/upload-artifact@v6
with:
if-no-files-found: error
include-hidden-files: true
name: dep-licenses-cache
path: .licenses/

check-deps:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive

# This is required to allow licensee/setup-licensed to install licensed via Ruby gem.
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Install latest version

- name: Install licensed
uses: licensee/setup-licensed@v1.3.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 5.x

- name: Install Task
uses: go-task/setup-task@v1

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: package.json

- name: Install project dependencies
run: sudo apt update -y && sudo apt install -y libxkbfile-dev libsecret-1-dev

- name: Check for dependencies with unapproved licenses
run: task --silent general:check-dep-licenses
61 changes: 61 additions & 0 deletions .licensed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# See: https://github.com/licensee/licensed/blob/main/docs/configuration.md

sources:
npm: true

ignored:
npm:
- arduino-ide-extension # this is a project in this repo
- electron-app # this is a project in this repo

# The following packages have some optional (architecutre native) packages.
- "@msgpackr-extract/msgpackr-extract-**" # ignored in favor of parent package "msgpackr-extract"
- "@parcel/watcher-**" # ignored in favor of parent package "@parcel-watcher"
- "@vscode/windows-ca-certs" # BSD license (https://www.npmjs.com/package/@vscode/windows-ca-certs)

- "@theia/test" # missing license file in package, epl-2.0 license
- buffers # missing license file in package, mit license (https://sources.debian.org/copyright/license/node-buffers/0.1.1-2/)
- chainsaw # missing license file in package, mit license (https://www.npmjs.com/package/chainsaw)

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies/AGPL-3.0/.licensed.yml
allowed:
- gpl-1.0-or-later
- gpl-1.0+ # Deprecated ID for `gpl-1.0-or-later`
- gpl-2.0-or-later
- gpl-2.0+ # Deprecated ID for `gpl-2.0-or-later`
- gpl-3.0-only
- gpl-3.0 # Deprecated ID for `gpl-3.0-only`
- gpl-3.0-or-later
- gpl-3.0+ # Deprecated ID for `gpl-3.0-or-later`
- lgpl-2.0-or-later
- lgpl-2.0+ # Deprecated ID for `lgpl-2.0-or-later`
- lgpl-2.1-only
- lgpl-2.1 # Deprecated ID for `lgpl-2.1-only`
- lgpl-2.1-or-later
- lgpl-2.1+ # Deprecated ID for `lgpl-2.1-or-later`
- lgpl-3.0-only
- lgpl-3.0 # Deprecated ID for `lgpl-3.0-only`
- lgpl-3.0-or-later
- lgpl-3.0+ # Deprecated ID for `lgpl-3.0-or-later`
- agpl-1.0-or-later
- agpl-3.0-only
- agpl-3.0 # Deprecated ID for `agpl-3.0-only`
- agpl-3.0-or-later
- apache-2.0
- mit
- bsd-2-clause # Subsumed by `bsd-2-clause-views`
- bsd-2-clause-netbsd # Deprecated ID for `bsd-2-clause`
- bsd-2-clause-views # This is the version linked from https://www.gnu.org/licenses/license-list.html#FreeBSD
- bsd-2-clause-freebsd # Deprecated ID for `bsd-2-clause-views`
- bsd-3-clause
- bsd-3-clause-clear
- isc
- cc0-1.0
- unlicense

- epl-2.0 # https://interoperable-europe.ec.europa.eu/licence/compatibility-check/EPL-2.0/AGPL-3.0-only
- 0bsd # https://interoperable-europe.ec.europa.eu/licence/compatibility-check/0bsd/AGPL-3.0-only
- CC-BY-4.0 # https://interoperable-europe.ec.europa.eu/licence/compatibility-check/CC-BY-4.0/AGPL-3.0-only
- blueoak-1.0.0
- Python-2.0
- OFL-1.1
33 changes: 33 additions & 0 deletions .licenses/npm/@babel/code-frame.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: "@babel/code-frame"
version: 7.26.2
type: npm
summary: Generate errors that contain a code frame that point to source locations.
homepage: https://babel.dev/docs/en/next/babel-code-frame
license: mit
licenses:
- sources: LICENSE
text: |
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
33 changes: 33 additions & 0 deletions .licenses/npm/@babel/generator.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: "@babel/generator"
version: 7.26.10
type: npm
summary: Turns an AST into code.
homepage: https://babel.dev/docs/en/next/babel-generator
license: mit
licenses:
- sources: LICENSE
text: |
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
33 changes: 33 additions & 0 deletions .licenses/npm/@babel/helper-module-imports.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: "@babel/helper-module-imports"
version: 7.25.9
type: npm
summary: Babel helper functions for inserting module loads
homepage: https://babel.dev/docs/en/next/babel-helper-module-imports
license: mit
licenses:
- sources: LICENSE
text: |
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
33 changes: 33 additions & 0 deletions .licenses/npm/@babel/helper-string-parser.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: "@babel/helper-string-parser"
version: 7.25.9
type: npm
summary: A utility package to parse strings
homepage: https://babel.dev/docs/en/next/babel-helper-string-parser
license: mit
licenses:
- sources: LICENSE
text: |
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
33 changes: 33 additions & 0 deletions .licenses/npm/@babel/helper-validator-identifier.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: "@babel/helper-validator-identifier"
version: 7.25.9
type: npm
summary: Validate identifier/keywords name
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License

Copyright (c) 2014-present Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []
Loading
Loading