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 <[email protected]>
  • Loading branch information
nickvergessen committed Oct 10, 2023
1 parent b41c534 commit 8a9fa2e
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 470 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.

56 changes: 43 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,37 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

outputs:
src: ${{ steps.changes.outputs.src}}

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
needs: changes
if: needs.changes.outputs.src == 'true'

name: NPM lint

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

- name: Lint
run: npm run lint

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: [changes, 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 ${{ needs.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.

52 changes: 41 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,35 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

outputs:
src: ${{ steps.changes.outputs.src}}

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
needs: changes
if: needs.changes.outputs.src == 'true'

name: NPM build
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
Expand Down Expand Up @@ -71,3 +86,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: [changes, 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 ${{ needs.changes.outputs.src == 'true' && needs.build.result != 'success' }}; then exit 1; fi
Loading

0 comments on commit 8a9fa2e

Please sign in to comment.