-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (36 loc) · 1.05 KB
/
precious.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
name: Precious
on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
jobs:
code-formatting:
runs-on: ubuntu-latest
name: Code Formatting
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm install
- name: Fetch base ref
if: ${{ github.event.pull_request }}
run: git fetch origin ${{ github.base_ref }}:upstream
- name: Install precious
run: ./bin/install-precious /usr/local/bin
- run: git diff --name-only --diff-filter=ACM upstream...
- name: Select files
id: select-files
run: |
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
echo 'precious-args=--git-diff-from upstream' >> "$GITHUB_OUTPUT"
else
echo 'precious-args=--all' >> "$GITHUB_OUTPUT"
fi
- name: Lint files
run: precious lint ${{ steps.select-files.outputs.precious-args }}