-
Notifications
You must be signed in to change notification settings - Fork 98
44 lines (43 loc) · 1.28 KB
/
status.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
name: PR status checks
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Use Cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package-lock.json') }}
- name: Install and build
run: |
npm install
- name: Run status checks
id: status_check
run: |
mkdir -p pr
# Run status checks, Remove ANSI colors from the text
output=$(npx ts-node ./status-checks/index.ts | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g')
cat <<< "$output" > "./pr/status-check-output"
echo ${{ github.event.number }} > ./pr/number
- uses: actions/upload-artifact@v2
with:
name: pr
path: pr/
retention-days: 1