소스 검색

Stop unnecessary lint workflows from running on pushing tags (#676)

Ref:
-
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore
-
https://stackoverflow.com/questions/77667104/how-to-make-github-action-trigger-on-push-paths-and-push-tags
- https://github.com/orgs/community/discussions/26273
Manav Rathi 1 년 전
부모
커밋
ef553d9401
3개의 변경된 파일19개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 3
      .github/workflows/auth-lint.yml
  2. 3 2
      .github/workflows/mobile-lint.yml
  3. 12 2
      .github/workflows/web-lint.yml

+ 4 - 3
.github/workflows/auth-lint.yml

@@ -1,12 +1,13 @@
 name: "Lint (auth)"
 
 on:
-    # Run on every push (this also covers pull requests)
+    # Run on every push to branches (this also covers pull requests)
     push:
+        # See: [Note: Specify branch when specifying a path filter]
+        branches: ["**"]
+        # Only run if something changes in these paths
         paths:
-            # - But only if something changes inside auth
             - "auth/**"
-            # - Or if the there is some change in workflow itself
             - ".github/workflows/auth-lint.yml"
 
 jobs:

+ 3 - 2
.github/workflows/mobile-lint.yml

@@ -3,10 +3,11 @@ name: "Lint (mobile)"
 on:
     # Run on every push (this also covers pull requests)
     push:
+        # See: [Note: Specify branch when specifying a path filter]
+        branches: ["**"]
+        # Only run if something changes in these paths
         paths:
-            # - But only if something changes inside mobile
             - "mobile/**"
-            # - Or if the there is some change in workflow itself
             - ".github/workflows/mobile-lint.yml"
 
 jobs:

+ 12 - 2
.github/workflows/web-lint.yml

@@ -3,10 +3,20 @@ name: "Lint (web)"
 on:
     # Run on every push (this also covers pull requests)
     push:
+        # [Note: Specify branch when specifying a path filter]
+        #
+        # Path filters are ignored for tag pushes, which causes this workflow to
+        # always run when we push a tag. Defining an explicit branch solves the
+        # issue. From GitHub's docs:
+        #
+        # > if you define both branches/branches-ignore and paths/paths-ignore,
+        # > the workflow will only run when both filters are satisfied.
+        #
+        # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
+        branches: ["**"]
+        # Only run if something changes in these paths
         paths:
-            # - But only if something changes inside web
             - "web/**"
-            # - Or if the there is some change in workflow itself
             - ".github/workflows/web-lint.yml"
 
 jobs: