Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create main.yml #2

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/main.yml
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 }}
Loading