-
-
Notifications
You must be signed in to change notification settings - Fork 32
35 lines (35 loc) · 1.1 KB
/
test-diff.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
name: test-diff
on:
push:
pull_request:
jobs:
test-diff:
permissions:
contents: read
name: "Run secretlint to diff files"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
# fetch history to get all changed files on push or pull_request event
fetch-depth: 1000
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- name: setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Show changed files
run: echo "${{ steps.changed-files.outputs.all_changed_files }}"
- name: Install
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn install
- name: Build
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn run build
- name: Run secretlint
if: steps.changed-files.outputs.any_changed == 'true'
run: ./node_modules/.bin/secretlint ${{ steps.changed-files.outputs.all_changed_files }}