Browse Source

Optimize CI workflow to avoid duplicate runs

Update GitHub Actions workflow triggers to prevent duplicate CI runs when creating pull requests. Now workflows only run on:
- Push events to master branch
- Pull request events (opened, synchronize, reopened)

This eliminates redundant CI runs when pushing to feature branches and creating PRs.
onevcat 7 months ago
parent
commit
2622536b4a
2 changed files with 12 additions and 2 deletions
  1. 6 1
      .github/workflows/build.yaml
  2. 6 1
      .github/workflows/test.yaml

+ 6 - 1
.github/workflows/build.yaml

@@ -4,7 +4,12 @@ defaults:
   run:
     shell: bash -leo pipefail {0}
 
-on: [push, pull_request]
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    types: [opened, synchronize, reopened]
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}

+ 6 - 1
.github/workflows/test.yaml

@@ -4,7 +4,12 @@ defaults:
   run:
     shell: bash -leo pipefail {0}
 
-on: [push, pull_request]
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    types: [opened, synchronize, reopened]
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}