Skip to content

Commit

Permalink
simplify logic
Browse files Browse the repository at this point in the history
this code solves a rare problem and could go in a separate PR after
discussion

the "unknown files" detection would support this scenario:

- a new config file or folder gets merged in without being included
  in filters.yml.
- time passes.
- a small pr modifies that config, breaking the ci job, which is skipped
  because filters.yml is out of date.
  • Loading branch information
p2edwards committed Dec 2, 2024
1 parent 5682f59 commit df60d52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ npm-test:
- '{.editorconfig,.prettier*,.stylelint*,.eslint*,coffeelint*}' # linters
- '.gitignore' # (can affect tools)
- '.github/workflows/npm-test.yml' # ci

unknown: # return 'true' if a file was added but not listed here yet
- '!(((\.github|\.storybook|\.tx|cypress|dependencies|docker|hub|jsapp|kobo|kpi|patches|scripts|static|test|webpack)/**)|(\.babelrc\.json|\.browserslistrc|\.coveragerc|\.dockerignore|\.editorconfig|\.eslintignore|\.eslintrc\.js|\.git-blame-ignore-revs|\.gitattributes|\.gitignore|\.gitlab-ci\.yml|\.gitmodules|\.node-version|\.nvmrc|\.prettierrc\.js|\.stylelintrc\.js|\.swcrc|CONTRIBUTING\.md|Dockerfile|LICENSE|README\.md|coffeelint\.json|dependabot\.yml|format-python\.sh|kpi\.code-workspace|locale|manage\.py|package-lock\.json|package\.json|pip-compile\.sh|pyproject\.toml|tsconfig\.json))'
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
darker: ${{ steps.filter.outputs.darker }}
pytest: ${{ steps.filter.outputs.pytest }}
npm-test: ${{ steps.filter.outputs.npm-test }}
unknown: ${{ steps.filter.outputs.unknown }}

darker:
needs: changes
Expand All @@ -26,13 +25,9 @@ jobs:
pytest:
needs: changes
uses: ./.github/workflows/pytest.yml
if: |
needs.changes.outputs.pytest == 'true' ||
needs.changes.outputs.unknown == 'true'
if: needs.changes.outputs.pytest == 'true'

npm-test:
needs: changes
uses: ./.github/workflows/npm-test.yml
if: |
needs.changes.outputs.npm-test == 'true' ||
needs.changes.outputs.unknown == 'true'
if: needs.changes.outputs.npm-test == 'true'

0 comments on commit df60d52

Please sign in to comment.