forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (78 loc) · 2.5 KB
/
lint.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
78
79
80
81
82
83
name: Linter
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
# pull_request includes [opened, reopened, synchronize] events by default
# 'edited' is required for title-lint
on:
push: {}
pull_request:
types: [opened, reopened, synchronize, edited]
pull_request_target:
types: [opened, reopened, synchronize, edited]
jobs:
# eslint:
# name: ESLint
# if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# with:
# version: 9
# - uses: actions/setup-node@v4
# with:
# node-version: lts/*
# cache: 'pnpm'
# - run: pnpm i
# - name: Lint
# run: pnpm run lint
# https://github.com/actions/starter-workflows/blob/main/code-scanning/eslint.yml
eslint-warning:
name: Lint
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- run: pnpm i
- name: Lint
run: pnpm run lint
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: eslint-results.sarif
wait-for-processing: true
# https://github.com/amannn/action-semantic-pull-request
title-lint:
if: ${{ github.event_name == 'pull_request_target' && github.repository == 'DIYgod/RSSHub' }}
name: Validate PR title
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ignoreLabels: |
dependencies
wip: true
labeler:
name: Pull Request Labeler
if: ${{ github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' && github.repository == 'DIYgod/RSSHub' }}
permissions:
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}