Browse Source

build(ci): Add/fix missing stylelint for PRs (#23440)

We were running stylelint on `master` pushes, but not PRs
Billy Vong 4 years ago
parent
commit
cb604281cf
2 changed files with 13 additions and 2 deletions
  1. 7 1
      .github/file-filters.yml
  2. 6 1
      .github/workflows/js-build-and-lint.yml

+ 7 - 1
.github/file-filters.yml

@@ -2,8 +2,11 @@
 
 # TODO: There are some meta files that we potentially could ignore for both front/backend,
 # as well as some configuration files that should trigger both
-frontend_lintable: &frontend_lintable
+frontend_components_lintable: &frontend_components_lintable
   - '**/*.[tj]{s,sx}'
+
+frontend_lintable: &frontend_lintable
+  - *frontend_components_lintable
   - '**/tsconfig*.json'
   - '{package,now,vercel}.json'
   - '.github/workflows/js-*.yml'
@@ -20,6 +23,9 @@ frontend: &frontend
 frontend_modified_lintable:
   - added|modified: *frontend_lintable
 
+frontend_components_modified_lintable:
+  - added|modified: *frontend_components_lintable
+
 backend_lintable: &backend_lintable
   - '**/*.py'
 

+ 6 - 1
.github/workflows/js-build-and-lint.yml

@@ -24,7 +24,7 @@ jobs:
           private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
 
       - name: Check for frontend file changes
-        uses: getsentry/paths-filter@v2
+        uses: getsentry/paths-filter@master
         id: changes
         with:
           list-files: shell
@@ -77,6 +77,11 @@ jobs:
         run: |
           yarn eslint --fix ${{ steps.changes.outputs.frontend_modified_lintable_files }}
 
+      - name: stylelint (changed files only)
+        if: github.ref != 'refs/heads/master' && steps.changes.outputs.frontend_components_modified_lintable == 'true'
+        run: |
+          yarn stylelint ${{ steps.changes.outputs.frontend_components_modified_lintable_files }}
+
       # Check (and error) for dirty working tree for forks
       # Reason being we need a different token to auto commit changes and
       # forks do not have access to said token