Skip to content

Commit 902d3db

Browse files
GvieveGenevieve Nuebel
andauthored
Implement path-based triggers to prevent spurious publish/release (#69)
Problem: Any push to master triggered publish and release workflows, including enhancement PRs that only changed .github/ files or documentation. Solution: Path-based triggers that only publish when SDK code changes. Changes: - Created on-push-master.yml with explicit path filters for SDK files - Updated publish.yml: added workflow_call trigger, removed push trigger - Updated release.yml: added workflow_call trigger, removed push trigger Behavior after this change: ✅ SDK file changes (api.ts, package.json, etc.) → triggers publish/release ✅ Workflow changes (.github/**) → does NOT trigger publish/release ✅ Documentation changes (README.md) → does NOT trigger publish/release This allows safe merging of workflow enhancements, config updates, and documentation without triggering package releases. Refs: Multi-version-POC-blockers.md Phase 1 Co-authored-by: Genevieve Nuebel <genevieve.nuebel@mx.com>
1 parent b9c0358 commit 902d3db

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: On Push to Master
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
# Root-level SDK files (current structure)
8+
# Only trigger publish/release when SDK code changes
9+
- 'api.ts'
10+
- 'base.ts'
11+
- 'common.ts'
12+
- 'configuration.ts'
13+
- 'index.ts'
14+
- 'package.json'
15+
- 'tsconfig.json'
16+
- 'tsconfig.esm.json'
17+
- 'dist/**'
18+
- '.openapi-generator/**'
19+
20+
jobs:
21+
Publish:
22+
uses: ./.github/workflows/publish.yml
23+
secrets: inherit
24+
25+
Release:
26+
uses: ./.github/workflows/release.yml
27+
secrets: inherit

.github/workflows/publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: Publish
22

33
on:
4-
push:
5-
branches: [master]
64
repository_dispatch:
75
types: [publish_sdk]
86
workflow_dispatch:
7+
workflow_call:
98

109
jobs:
1110
Publish:

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Release
22

33
on:
4-
push:
5-
branches: [ master ]
64
repository_dispatch:
75
types: [release_sdk]
6+
workflow_call:
87

98
jobs:
109
Release:

0 commit comments

Comments
 (0)