2021-05-07 16:36:52 +00:00
|
|
|
name: PR status checks
|
|
|
|
on:
|
2022-01-11 18:33:40 +00:00
|
|
|
pull_request_target:
|
2021-05-07 16:36:52 +00:00
|
|
|
types: [assigned, opened, synchronize, reopened]
|
2022-01-11 18:33:40 +00:00
|
|
|
|
2021-05-07 16:36:52 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-03 18:22:41 +00:00
|
|
|
permissions:
|
2022-02-20 19:50:33 +00:00
|
|
|
contents: write
|
2021-05-07 16:36:52 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [16.x]
|
|
|
|
steps:
|
2021-09-02 07:30:48 +00:00
|
|
|
- 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
|
2021-09-02 17:26:29 +00:00
|
|
|
id: status_check
|
|
|
|
run: |
|
2022-03-03 18:33:31 +00:00
|
|
|
mkdir -p pr
|
2021-09-07 19:01:20 +00:00
|
|
|
# Run status checks, Remove ANSI colors from the text
|
2022-03-03 18:22:41 +00:00
|
|
|
output=$(npx ts-node ./status-checks/index.ts | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g')
|
2022-02-20 19:50:33 +00:00
|
|
|
cat <<< "$output" > "./pr/status-check-output"
|
|
|
|
echo ${{ github.event.number }} > ./pr/number
|
|
|
|
- uses: actions/upload-artifact@v2
|
2021-09-02 17:26:29 +00:00
|
|
|
with:
|
2022-02-20 19:50:33 +00:00
|
|
|
name: pr
|
|
|
|
path: pr/
|
|
|
|
retention-days: 1
|