|
5 | 5 | branches: [ main, develop ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ main, develop ] |
| 8 | + # Allow manual runs |
| 9 | + workflow_dispatch: |
8 | 10 |
|
9 | 11 | jobs: |
10 | 12 | test: |
@@ -102,7 +104,14 @@ jobs: |
102 | 104 | name: Docker Test |
103 | 105 | runs-on: ubuntu-latest |
104 | 106 | needs: test |
105 | | - if: github.event_name == 'push' |
| 107 | + # Run Docker Test only when explicitly requested via commit message flag |
| 108 | + # (e.g., include [docker-test] in the commit message) or when running on tags/branches on CI |
| 109 | + # Run when explicitly requested by commit message, PR label, tag push, or manual dispatch |
| 110 | + if: | |
| 111 | + contains(github.event.head_commit.message, '[docker-test]') || |
| 112 | + startsWith(github.ref, 'refs/tags/') || |
| 113 | + github.event_name == 'workflow_dispatch' || |
| 114 | + (github.event_name == 'pull_request' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-full-ci')) |
106 | 115 | |
107 | 116 | steps: |
108 | 117 | - name: Checkout code |
@@ -148,7 +157,13 @@ jobs: |
148 | 157 | security: |
149 | 158 | name: Security Scan |
150 | 159 | runs-on: ubuntu-latest |
151 | | - if: github.event_name == 'push' |
| 160 | + # Run Security Scan only when explicitly requested via commit message flag |
| 161 | + # (e.g., include [security-scan] in the commit message) or when running manually |
| 162 | + # Run when explicitly requested by commit message, PR label, or manual dispatch |
| 163 | + if: | |
| 164 | + contains(github.event.head_commit.message, '[security-scan]') || |
| 165 | + github.event_name == 'workflow_dispatch' || |
| 166 | + (github.event_name == 'pull_request' && contains(join(github.event.pull_request.labels.*.name, ','), 'run-security')) |
152 | 167 | |
153 | 168 | steps: |
154 | 169 | - name: Checkout code |
|
0 commit comments