From 0dd9ef82937a164502da003620c01bfc6e4b6af3 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 31 Jan 2024 13:40:57 -0800 Subject: [PATCH 1/3] Install referenced schema in "npm:validate" task The "npm:validate" task validates the repository's `package.json` npm manifest file against its JSON schema to catch any problems with its data format. In order to avoid duplication of content, JSON schemas may reference other schemas via the `$ref` keyword. The `package.json` schema was recently updated to share resources with the "base" configuration schema, which caused the validation to start failing: schema /tmp/package-json-schema-norSGPxlCR.json is invalid error: can't resolve reference https://json.schemastore.org/base.json#/definitions/license from id https://json.schemastore.org/package.json# task: Failed to run task "npm:validate": exit status 1 The solution is to configure the task to download that schema as well and also to provide its path to the avj-cli validator via a `-r` flag. --- Taskfile.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index 1c8f6287..af034724 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -147,6 +147,10 @@ tasks: AVA_SCHEMA_URL: https://json.schemastore.org/ava.json AVA_SCHEMA_PATH: sh: task utility:mktemp-file TEMPLATE="ava-schema-XXXXXXXXXX.json" + # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/base.json + BASE_SCHEMA_URL: https://json.schemastore.org/base.json + BASE_SCHEMA_PATH: + sh: task utility:mktemp-file TEMPLATE="base-schema-XXXXXXXXXX.json" # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/eslintrc.json ESLINTRC_SCHEMA_URL: https://json.schemastore.org/eslintrc.json ESLINTRC_SCHEMA_PATH: @@ -184,6 +188,7 @@ tasks: cmds: - wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}} - wget --quiet --output-document="{{.AVA_SCHEMA_PATH}}" {{.AVA_SCHEMA_URL}} + - wget --quiet --output-document="{{.BASE_SCHEMA_PATH}}" {{.BASE_SCHEMA_URL}} - wget --quiet --output-document="{{.ESLINTRC_SCHEMA_PATH}}" {{.ESLINTRC_SCHEMA_URL}} - wget --quiet --output-document="{{.JSCPD_SCHEMA_PATH}}" {{.JSCPD_SCHEMA_URL}} - wget --quiet --output-document="{{.NPM_BADGES_SCHEMA_PATH}}" {{.NPM_BADGES_SCHEMA_URL}} @@ -197,6 +202,7 @@ tasks: --all-errors \ -s "{{.SCHEMA_PATH}}" \ -r "{{.AVA_SCHEMA_PATH}}" \ + -r "{{.BASE_SCHEMA_PATH}}" \ -r "{{.ESLINTRC_SCHEMA_PATH}}" \ -r "{{.JSCPD_SCHEMA_PATH}}" \ -r "{{.NPM_BADGES_SCHEMA_PATH}}" \ From 91b36bbae0e3ac1cb1cb3497b8933ed00ce77da7 Mon Sep 17 00:00:00 2001 From: pdebakker-auguria <153522278+pdebakker-auguria@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:01:43 +0100 Subject: [PATCH 2/3] updated default protoc version from 23.x to 26.x (#100) --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a991b1a5..1eaff061 100644 --- a/action.yml +++ b/action.yml @@ -3,8 +3,8 @@ description: 'Download protoc compiler and add it to the PATH' author: 'Arduino' inputs: version: - description: 'Version to use. Example: 23.2' - default: '23.x' + description: 'Version to use. Example: 26.2' + default: '26.x' include-pre-releases: description: 'Include github pre-releases in latest version calculation' default: 'false' From 436c800511f206be44ae58917824c83498bed1fc Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 3 Sep 2024 13:06:31 -0700 Subject: [PATCH 3/3] Configure actions/upload-artifact action to upload required hidden files A breaking change was made in the 3.2.1 release of the "actions/upload-artifact" action, without doing a major version bump as would be done in a responsibly maintained project. The action now defaults to not uploading "hidden" files. This project's "Check npm Dependencies" workflow uses the "Licensed" tool to check for incompatible dependency licenses. The dependencies license metadata cache used by Licensed is stored in a folder named `.licensed`. In order to facilitate updates, the workflow uploads the generated dependencies license metadata cache as a workflow artifact when the current cache is found to be outdated. The `.` at the start of the `.licensed` folder name causes it to now not be uploaded to the workflow artifact. In order to catch such problems, the workflow configures the "actions/upload-artifact" action to fail if no files were uploaded. So in addition to not uploading the artifact, the change in the "actions/upload-artifact" action's behavior also resulted in the workflow runs failing: Error: No files were found with the provided path: .licenses/. No artifacts will be uploaded. The problem is fixed by disabling the "actions/upload-artifact" action's new behavior via the `include-hidden-files` input. After this change, the workflow can once more upload the dependencies license metadata cache to a workflow artifact as needed. --- .github/workflows/check-npm-dependencies-task.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-npm-dependencies-task.yml b/.github/workflows/check-npm-dependencies-task.yml index 3cde23fd..8455ee03 100644 --- a/.github/workflows/check-npm-dependencies-task.yml +++ b/.github/workflows/check-npm-dependencies-task.yml @@ -105,6 +105,7 @@ jobs: uses: actions/upload-artifact@v3 with: if-no-files-found: error + include-hidden-files: true name: dep-licenses-cache path: .licenses/