Skip to content

Commit

Permalink
Always use the normal action and just make the execution dependent on…
Browse files Browse the repository at this point in the history
… the changed files

Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Oct 10, 2023
1 parent b41c534 commit 25accf4
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 466 deletions.
14 changes: 0 additions & 14 deletions workflow-templates/lint-eslint-when-unrelated.properties.json

This file was deleted.

102 changes: 0 additions & 102 deletions workflow-templates/lint-eslint-when-unrelated.yml

This file was deleted.

50 changes: 37 additions & 13 deletions workflow-templates/lint-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ name: Lint eslint

on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.eslintrc.*'
- '.eslintignore'
- '**.js'
- '**.ts'
- '**.vue'

permissions:
contents: read
Expand All @@ -31,10 +19,31 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

steps:
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
with:
filters: |
src:
- '.github/workflows/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.eslintrc.*'
- '.eslintignore'
- '**.js'
- '**.ts'
- '**.vue'
lint:
runs-on: ubuntu-latest

name: eslint
name: NPM lint

steps:
- name: Checkout
Expand Down Expand Up @@ -62,3 +71,18 @@ jobs:

- name: Lint
run: npm run lint

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build

if: always()

# This is the summary, we just avoid to rename it so that branch protection rules still match
name: eslint

steps:
- name: Summary status
run: if ${{ steps.changes.outputs.src == 'true' && needs.lint.result != 'success' }}; then exit 1; fi
11 changes: 0 additions & 11 deletions workflow-templates/node-when-unrelated.properties.json

This file was deleted.

107 changes: 0 additions & 107 deletions workflow-templates/node-when-unrelated.yml

This file was deleted.

48 changes: 37 additions & 11 deletions workflow-templates/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ name: Node

on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'
push:
branches:
- main
Expand All @@ -31,10 +21,31 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

steps:
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
with:
filters: |
src:
- '.github/workflows/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'
build:
runs-on: ubuntu-latest

name: node
if: steps.changes.outputs.src == 'true'

name: NPM build
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
Expand Down Expand Up @@ -71,3 +82,18 @@ jobs:
git status
git --no-pager diff
exit 1 # make it red to grab attention
summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build

if: always()

# This is the summary, we just avoid to rename it so that branch protection rules still match
name: node

steps:
- name: Summary status
run: if ${{ steps.changes.outputs.src == 'true' && needs.build.result != 'success' }}; then exit 1; fi
Loading

0 comments on commit 25accf4

Please sign in to comment.