-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 937 Bytes
/
main.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: CI
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '2'
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install modules
run: pnpm install
- name: Check changed files
uses: actions/github-script@v6
with:
script: |
const { execSync } = require('child_process')
const { commits } = context.payload.pull_request
console.log(commits)
const rawFiles = execSync(`git diff-tree --no-commit-id --name-only -r HEAD`).toString()
console.log('rawFiles', rawFiles)
const files = rawFiles.split('\n').filter(Boolean)
console.log(files)