-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (39 loc) · 1.16 KB
/
check-update.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
name: Check Update
on: push
jobs:
checkDocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
id: cache
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
registry-url: "https://registry.npmjs.org"
node-version: '12.x'
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Update Rules Docs
run: npm run update
- name: Check diff
id: check-diff
run: |
echo ::set-output name=diff-files::$(git diff --diff-filter=AM --name-only)
- name: Report
if: steps.check-diff.outputs.diff-files
uses: mshick/add-pr-comment@v1
with:
message: |
Please run `npm run update`
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: 'true'
- name: Exit
if: steps.check-diff.outputs.diff-files
run: exit 1