forked from xola/ui-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.28 KB
/
eslint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Lint
on:
push:
# Runs against the workflow and code from the merge commit
# pull_request:
# types: [ opened, synchronize, reopened ]
# Runs against the workflow and code from the base of the pull request
pull_request_target:
types: [opened, synchronize, reopened]
env:
DISABLE_PROGRESS: true
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
checks: write
jobs:
Lint:
name: ⚡ ES Lint
runs-on: ubuntu-latest
steps:
- name: Check user for team affiliation
uses: tspascoal/get-user-teams-membership@v2
id: checkUserMember
with:
GITHUB_TOKEN: ${{ secrets.ES_LINT_TOKEN }}
username: ${{ github.actor }}
organization: xola
team: 'Engineering,X2 Consultants'
- if: ${{ steps.checkUserMember.outputs.isTeamMember == 'false' }}
run: |
echo "Hey ${{ github.actor }} you are not in a whitelisted team"
exit 1
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{github.event.pull_request.head.sha}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Node.JS 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
cache-dependency-path: "package-lock.json"
- name: Install Node Dependencies
run: npm ci --no-fund --no-audit
- name: Save Code Linting Report to JSON
# This is to show failures in GitHub pull request using the action below
run: npm run lint:report
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/[email protected]
with:
check-name: "View Lint Report"
markdown-report-on-step-summary: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
report-json: "eslint_report.json"
# # OPTIONAL: save a copy of the usage report for download or use in another job
# # Save a copy of the usage report for download or use in another job
# - name: Upload ESLint report
# uses: actions/upload-artifact@v3
# with:
# name: eslint_report.json
# path: eslint_report.json