Skip to content

Commit 16df4a7

Browse files
committed
ci: gate heavy workflows to tags and explicit flags/labels
1 parent db3f230 commit 16df4a7

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Build and Release
22

33
on:
44
push:
5+
# Only trigger the heavy multi-platform build on version tag pushes (e.g. v1.9.1)
56
tags:
67
- 'v*'
7-
branches: [ main ]
8-
pull_request:
9-
branches: [ main ]
8+
# Allow manual dispatch for ad-hoc builds from the UI
9+
workflow_dispatch:
1010

1111
permissions:
1212
contents: read

.github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches: [ main, develop ]
66
pull_request:
77
branches: [ main, develop ]
8+
# Allow manual runs
9+
workflow_dispatch:
810

911
jobs:
1012
test:
@@ -102,7 +104,14 @@ jobs:
102104
name: Docker Test
103105
runs-on: ubuntu-latest
104106
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'))
106115
107116
steps:
108117
- name: Checkout code
@@ -148,7 +157,13 @@ jobs:
148157
security:
149158
name: Security Scan
150159
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'))
152167
153168
steps:
154169
- name: Checkout code

0 commit comments

Comments
 (0)