Skip to content

Commit 082eecc

Browse files
committed
get rid of the stylelint plugin, add stylelint action
Signed-off-by: Julien Veyssier <[email protected]>
1 parent 42c5e38 commit 082eecc

4 files changed

Lines changed: 1047 additions & 727 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint stylelint
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-stylelint-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
changes:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
27+
outputs:
28+
src: ${{ steps.changes.outputs.src}}
29+
30+
steps:
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
32+
id: changes
33+
continue-on-error: true
34+
with:
35+
filters: |
36+
src:
37+
- '.github/workflows/**'
38+
- 'src/**'
39+
- 'appinfo/info.xml'
40+
- 'package.json'
41+
- 'package-lock.json'
42+
- 'tsconfig.json'
43+
- 'stylelint.config.*'
44+
- '**.js'
45+
- '**.ts'
46+
- '**.vue'
47+
48+
lint:
49+
runs-on: ubuntu-latest
50+
51+
needs: changes
52+
if: needs.changes.outputs.src != 'false'
53+
54+
name: NPM stylelint
55+
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
59+
with:
60+
persist-credentials: false
61+
62+
- name: Read package.json node and npm engines version
63+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
64+
id: versions
65+
with:
66+
fallbackNode: '^20'
67+
fallbackNpm: '^10'
68+
69+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
70+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
71+
with:
72+
node-version: ${{ steps.versions.outputs.nodeVersion }}
73+
74+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
75+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
76+
77+
- name: Install dependencies
78+
env:
79+
CYPRESS_INSTALL_BINARY: 0
80+
PUPPETEER_SKIP_DOWNLOAD: true
81+
run: npm ci
82+
83+
- name: Lint
84+
run: npm run stylelint
85+
86+
summary:
87+
permissions:
88+
contents: none
89+
runs-on: ubuntu-latest
90+
needs: [changes, lint]
91+
92+
if: always()
93+
94+
# This is the summary, we just avoid to rename it so that branch protection rules still match
95+
name: stylelint
96+
97+
steps:
98+
- name: Summary status
99+
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)