From c637133972920810e571c88c9548ee2ca82da11d Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:24:54 -0300 Subject: [PATCH 1/9] feat: add reusable ESLint workflow --- .github/workflows/lint-eslint.yml | 99 +++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/lint-eslint.yml diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml new file mode 100644 index 0000000..80a60af --- /dev/null +++ b/.github/workflows/lint-eslint.yml @@ -0,0 +1,99 @@ +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +# SPDX-License-Identifier: MIT + +name: Lint eslint + +on: + workflow_call: + +permissions: + contents: read + +concurrency: + group: lint-eslint-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + src: ${{ steps.changes.outputs.src }} + steps: + - name: Detect JavaScript changes + id: changes + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + continue-on-error: true + with: + filters: | + src: + - '.github/workflows/**' + - 'src/**' + - 'appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '.eslintrc.*' + - '.eslintignore' + - '**.js' + - '**.ts' + - '**.vue' + + lint: + runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.src != 'false' + name: NPM lint + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json engines + id: versions + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Enforce package engine requirements + run: | + npm --version + npm config set engine-strict true + + - name: Install dependencies + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: npm ci + + - name: Lint + run: npm run lint + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: + - changes + - lint + if: always() + name: eslint + steps: + - name: Summary status + env: + CHANGED: ${{ needs.changes.outputs.src }} + LINT_RESULT: ${{ needs.lint.result }} + run: | + if [ "$CHANGED" != "false" ] && [ "$LINT_RESULT" != "success" ]; then + exit 1 + fi From 28874b9141c73178d13aae163503d673d52df5a8 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:24:57 -0300 Subject: [PATCH 2/9] feat: add reusable stylelint workflow --- .github/workflows/lint-stylelint.yml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/lint-stylelint.yml diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml new file mode 100644 index 0000000..6e8acce --- /dev/null +++ b/.github/workflows/lint-stylelint.yml @@ -0,0 +1,51 @@ +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +# SPDX-License-Identifier: MIT + +name: Lint stylelint + +on: + workflow_call: + +permissions: + contents: read + +concurrency: + group: lint-stylelint-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + name: stylelint + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Read package.json engines + id: versions + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + with: + fallbackNode: '^24' + fallbackNpm: '^11.3' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Enforce package engine requirements + run: | + npm --version + npm config set engine-strict true + + - name: Install dependencies + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: npm ci + + - name: Lint + run: npm run stylelint From dbbf390169dbe1a014f0da414168e3ac51a6dfd5 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:25:11 -0300 Subject: [PATCH 3/9] feat: add ESLint caller template --- workflow-templates/lint-eslint.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 workflow-templates/lint-eslint.yml diff --git a/workflow-templates/lint-eslint.yml b/workflow-templates/lint-eslint.yml new file mode 100644 index 0000000..48c9dfc --- /dev/null +++ b/workflow-templates/lint-eslint.yml @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +# This workflow is published through the LibreCode organization catalog. +# Implementation: LibreCodeCoop/github-workflows + +name: Lint eslint + +on: pull_request + +permissions: + contents: read + +jobs: + eslint: + uses: LibreCodeCoop/github-workflows/.github/workflows/lint-eslint.yml@28874b9141c73178d13aae163503d673d52df5a8 From 52b1792ce7d5677dd61cef719e01d725fcda8609 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:25:14 -0300 Subject: [PATCH 4/9] feat: add ESLint template metadata --- workflow-templates/lint-eslint.properties.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 workflow-templates/lint-eslint.properties.json diff --git a/workflow-templates/lint-eslint.properties.json b/workflow-templates/lint-eslint.properties.json new file mode 100644 index 0000000..1e1ea10 --- /dev/null +++ b/workflow-templates/lint-eslint.properties.json @@ -0,0 +1,7 @@ +{ + "name": "Lint ESLint", + "description": "Run the project's ESLint checks with the Node version declared by the project.", + "iconName": "octicon code-review", + "categories": ["JavaScript"], + "filePatterns": ["^package.json$"] +} From f438f1d5d1223781d51fb60af9e11e56dadd22a5 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:25:16 -0300 Subject: [PATCH 5/9] chore: license ESLint template metadata --- workflow-templates/lint-eslint.properties.json.license | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 workflow-templates/lint-eslint.properties.json.license diff --git a/workflow-templates/lint-eslint.properties.json.license b/workflow-templates/lint-eslint.properties.json.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/workflow-templates/lint-eslint.properties.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later From e88c5029955f910fe94233f3e13963824afb2cda Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:25:19 -0300 Subject: [PATCH 6/9] feat: add stylelint caller template --- workflow-templates/lint-stylelint.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 workflow-templates/lint-stylelint.yml diff --git a/workflow-templates/lint-stylelint.yml b/workflow-templates/lint-stylelint.yml new file mode 100644 index 0000000..b3221d5 --- /dev/null +++ b/workflow-templates/lint-stylelint.yml @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +# This workflow is published through the LibreCode organization catalog. +# Implementation: LibreCodeCoop/github-workflows + +name: Lint stylelint + +on: pull_request + +permissions: + contents: read + +jobs: + stylelint: + uses: LibreCodeCoop/github-workflows/.github/workflows/lint-stylelint.yml@28874b9141c73178d13aae163503d673d52df5a8 From c139b3fdf01f4d74be530b97a6ec56214fecf58c Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:25:21 -0300 Subject: [PATCH 7/9] feat: add stylelint template metadata --- workflow-templates/lint-stylelint.properties.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 workflow-templates/lint-stylelint.properties.json diff --git a/workflow-templates/lint-stylelint.properties.json b/workflow-templates/lint-stylelint.properties.json new file mode 100644 index 0000000..ff858e7 --- /dev/null +++ b/workflow-templates/lint-stylelint.properties.json @@ -0,0 +1,7 @@ +{ + "name": "Lint stylelint", + "description": "Run the project's stylelint checks with the Node version declared by the project.", + "iconName": "octicon paintbrush", + "categories": ["JavaScript"], + "filePatterns": ["^package.json$"] +} From dd2b05c0005006cd422eea7cd846fb14200148a4 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:25:24 -0300 Subject: [PATCH 8/9] chore: license stylelint template metadata --- workflow-templates/lint-stylelint.properties.json.license | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 workflow-templates/lint-stylelint.properties.json.license diff --git a/workflow-templates/lint-stylelint.properties.json.license b/workflow-templates/lint-stylelint.properties.json.license new file mode 100644 index 0000000..1ce4e0c --- /dev/null +++ b/workflow-templates/lint-stylelint.properties.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 LibreCode coop and contributors +SPDX-License-Identifier: AGPL-3.0-or-later From 7785b7b051054e8b7befacf39643cc1938df5369 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 20 Sep 2026 01:27:24 -0300 Subject: [PATCH 9/9] fix: grant ESLint caller pull request read access --- workflow-templates/lint-eslint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow-templates/lint-eslint.yml b/workflow-templates/lint-eslint.yml index 48c9dfc..32f4cc1 100644 --- a/workflow-templates/lint-eslint.yml +++ b/workflow-templates/lint-eslint.yml @@ -10,6 +10,7 @@ on: pull_request permissions: contents: read + pull-requests: read jobs: eslint: