Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions .github/workflows/lint-stylelint.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions workflow-templates/lint-eslint.properties.json
Original file line number Diff line number Diff line change
@@ -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$"]
}
2 changes: 2 additions & 0 deletions workflow-templates/lint-eslint.properties.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
SPDX-License-Identifier: AGPL-3.0-or-later
17 changes: 17 additions & 0 deletions workflow-templates/lint-eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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
pull-requests: read

jobs:
eslint:
uses: LibreCodeCoop/github-workflows/.github/workflows/lint-eslint.yml@28874b9141c73178d13aae163503d673d52df5a8
7 changes: 7 additions & 0 deletions workflow-templates/lint-stylelint.properties.json
Original file line number Diff line number Diff line change
@@ -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$"]
}
2 changes: 2 additions & 0 deletions workflow-templates/lint-stylelint.properties.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
SPDX-License-Identifier: AGPL-3.0-or-later
16 changes: 16 additions & 0 deletions workflow-templates/lint-stylelint.yml
Original file line number Diff line number Diff line change
@@ -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
Loading