Skip to content

Commit f0c2e47

Browse files
committed
adding workflows#2
1 parent ff1a20c commit f0c2e47

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/lint-eslint.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions
7+
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
8+
9+
name: Lint eslint
10+
11+
on:
12+
pull_request:
13+
paths:
14+
- '.github/workflows/**'
15+
- 'src/**'
16+
- 'appinfo/info.xml'
17+
- 'package.json'
18+
- 'package-lock.json'
19+
- 'tsconfig.json'
20+
- '.eslintrc.*'
21+
- '.eslintignore'
22+
- '**.js'
23+
- '**.ts'
24+
- '**.vue'
25+
26+
permissions:
27+
contents: read
28+
29+
concurrency:
30+
group: lint-eslint-${{ github.head_ref || github.run_id }}
31+
cancel-in-progress: true
32+
33+
jobs:
34+
lint:
35+
runs-on: ubuntu-latest
36+
37+
name: eslint
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
42+
43+
- name: Read package.json node and npm engines version
44+
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
45+
id: versions
46+
with:
47+
fallbackNode: '^20'
48+
fallbackNpm: '^9'
49+
50+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
51+
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
52+
with:
53+
node-version: ${{ steps.versions.outputs.nodeVersion }}
54+
55+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
56+
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
57+
58+
- name: Install dependencies
59+
run: npm ci
60+
61+
- name: Lint
62+
run: npm run lint

0 commit comments

Comments
 (0)