aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-11-18 12:24:16 +0100
committerskjnldsv <skjnldsv@protonmail.com>2024-11-19 09:42:13 +0100
commit212cac94690ae9c9f0616cff8df69229be88dab1 (patch)
tree3315dfca074f99060406865be9ff51558aacd4cb /.github
parent899b65111d587e3a1848b14fd8459ffe037d7496 (diff)
downloadnextcloud-server-212cac94690ae9c9f0616cff8df69229be88dab1.tar.gz
nextcloud-server-212cac94690ae9c9f0616cff8df69229be88dab1.zip
ci: Enforce SCSS/CSS rules - add stylelint workflow
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/lint-stylelint.yml51
1 files changed, 51 insertions, 0 deletions
diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml
new file mode 100644
index 00000000000..659540f532c
--- /dev/null
+++ b/.github/workflows/lint-stylelint.yml
@@ -0,0 +1,51 @@
+# This workflow is provided via the organization template repository
+#
+# https://github.com/nextcloud/.github
+# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+#
+# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
+# SPDX-License-Identifier: MIT
+
+name: Lint stylelint
+
+on: pull_request
+
+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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
+
+ - name: Read package.json node and npm engines version
+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
+ id: versions
+ with:
+ fallbackNode: '^20'
+ fallbackNpm: '^10'
+
+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
+ with:
+ node-version: ${{ steps.versions.outputs.nodeVersion }}
+
+ - name: Set up npm ${{ steps.versions.outputs.npmVersion }}
+ run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
+
+ - name: Install dependencies
+ env:
+ CYPRESS_INSTALL_BINARY: 0
+ run: npm ci
+
+ - name: Lint
+ run: npm run stylelint