-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f8b206
commit 9666889
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
check-label: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
- name: Check for QA PASS label | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
const { data: pullRequest } = await github.rest.pulls.get({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.issue.number | ||
}); | ||
if (!pullRequest.labels.map(label => label.name).includes('QA PASS')) { | ||
throw new Error('Pull request does not have a QA PASS label'); | ||
} | ||
delete-branch: | ||
runs-on: ubuntu-latest | ||
needs: check-label | ||
|
||
steps: | ||
- name: Delete merged branch | ||
uses: pullreminders/delete-merged-branch@master | ||
if: github.event.pull_request.merged == true | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |