Update workflow

This commit is contained in:
Francisco Hodge 2021-08-02 12:33:37 -07:00
parent 9073de62d7
commit fe5551156e
3 changed files with 42 additions and 42 deletions

View File

@ -9,6 +9,7 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
if: contains(github.ref, 'master')
strategy:
matrix:
node-version: [12.x]

View File

@ -1,23 +1,24 @@
name: Build PR (Standard)
on: [pull_request]
on: pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
if: ${{ github.actor != 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'dependencies') }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') }}
strategy:
matrix:
node-version: [12.x]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: npm install, build, and test
run: |
npm install
npm run coverage
env:
CI: true
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: npm install, build, and test
run: |
npm install
npm run coverage
env:
CI: true

View File

@ -1,8 +1,6 @@
name: Build PR (Dependabot)
on:
pull_request_target:
types: [labeled]
on: pull_request_target
jobs:
build:
@ -13,29 +11,29 @@ jobs:
node-version: [12.x]
os: [ubuntu-latest]
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: npm install, build, and test
run: |
npm install
npm run coverage
env:
CI: true
- name: Merge PR
if: success()
uses: "pascalgn/automerge-action@v0.14.2"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: "dependencies"
- name: Reject PR
if: failure()
uses: peter-evans/close-pull@v1
with:
pull-request-number: ${{github.event.number}}
comment: "Closing PR due to failing tests."
delete-branch: true
- 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: npm install, build, and test
run: |
npm install
npm run coverage
env:
CI: true
- name: Merge PR
if: success()
uses: "pascalgn/automerge-action@v0.14.2"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: "dependencies"
- name: Reject PR
if: failure()
uses: peter-evans/close-pull@v1
with:
pull-request-number: ${{github.event.number}}
comment: "Closing PR due to failing tests."
delete-branch: true