Add script for validating PR title (#4050)
This commit is contained in:
2
.github/workflows/android-ci.yml
vendored
2
.github/workflows/android-ci.yml
vendored
@@ -69,7 +69,7 @@ jobs:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: npm install
|
||||
run: npm install --ignore-scripts
|
||||
run: npm ci --ignore-scripts
|
||||
working-directory: .
|
||||
shell: bash
|
||||
|
||||
|
||||
18
.github/workflows/typecheck-scripts.yml
vendored
18
.github/workflows/typecheck-scripts.yml
vendored
@@ -1,18 +0,0 @@
|
||||
name: typecheck-scripts
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
typecheck-scripts:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- run: |
|
||||
npm install
|
||||
npx tsc -p tsconfig.json
|
||||
22
.github/workflows/validate-pr-title.yml
vendored
Normal file
22
.github/workflows/validate-pr-title.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Validate PR title
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled, unlabeled, opened, edited]
|
||||
|
||||
jobs:
|
||||
validate-tags-match-title:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Check if labels match PR title
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }}
|
||||
run: node .github/scripts/validate-pr-title.ts
|
||||
26
.github/workflows/validate-scripts.yml
vendored
Normal file
26
.github/workflows/validate-scripts.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: validate-scripts
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
validate-scripts:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Typecheck
|
||||
run: |
|
||||
npm install
|
||||
npx tsc -p tsconfig.json
|
||||
|
||||
- name: Run tests
|
||||
run: node --test .github/scripts/**.test.ts
|
||||
Reference in New Issue
Block a user