Skip to content

Commit

Permalink
Only run CI on pull_requests or updates to master
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Dec 2, 2020
1 parent d825fe6 commit c369dde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/node-windows.yml
@@ -1,14 +1,18 @@
name: Node

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: windows-2019

strategy:
matrix:
node: ['14', '12', '10']
node: [ '14', '12', '10' ]

name: ${{ matrix.node }} (Windows)
steps:
Expand All @@ -20,7 +24,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm test
Expand Down
9 changes: 5 additions & 4 deletions src/utils/FileEmitter.ts
Expand Up @@ -103,10 +103,11 @@ export const FILE_PLACEHOLDER: FilePlaceholder = {
function hasValidType(
emittedFile: unknown
): emittedFile is { type: 'asset' | 'chunk'; [key: string]: unknown } {
return emittedFile
? (emittedFile as { [key: string]: unknown }).type === 'asset' ||
(emittedFile as { [key: string]: unknown }).type === 'chunk'
: false;
return Boolean(
emittedFile &&
((emittedFile as { [key: string]: unknown }).type === 'asset' ||
(emittedFile as { [key: string]: unknown }).type === 'chunk')
);
}

function hasValidName(emittedFile: {
Expand Down

0 comments on commit c369dde

Please sign in to comment.