-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (57 loc) · 2.13 KB
/
on-push-master.yml
File metadata and controls
61 lines (57 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: On Push to Master
on:
push:
branches: [master]
paths:
- 'v20111101/**'
- 'v20250224/**'
jobs:
# Check for skip-publish flag in commit message. This allows skipping publish/release for specific scenarios,
# such as testing generated code, migrating files to new paths, etc.
check-skip-publish:
runs-on: ubuntu-latest
outputs:
skip_publish: ${{ steps.check.outputs.skip_publish }}
steps:
- name: Check for [skip-publish] flag in commit message
id: check
run: |
COMMIT_MSG="${{ github.event.head_commit.message }}"
if [[ "$COMMIT_MSG" == *"[skip-publish]"* ]]; then
echo "skip_publish=true" >> $GITHUB_OUTPUT
echo "🚫 [skip-publish] flag detected - skipping all publish/release jobs"
else
echo "skip_publish=false" >> $GITHUB_OUTPUT
echo "✅ No skip flag - proceeding with publish/release"
fi
# Matrix-based publish and release: runs one job per version,
# conditionally based on path changes
# Each matrix iteration only executes if both conditions are true:
# 1. [skip-publish] flag is NOT present in commit message
# 2. Files in this version's directory were modified in the commit
publish:
needs: check-skip-publish
strategy:
matrix:
version:
- api_version: v20111101
- api_version: v20250224
fail-fast: false
if: needs.check-skip-publish.outputs.skip_publish == 'false' && contains(github.event.head_commit.modified, matrix.version.api_version)
uses: ./.github/workflows/publish.yml
with:
version_directory: ${{ matrix.version.api_version }}
secrets: inherit
release:
needs: [check-skip-publish, publish]
strategy:
matrix:
version:
- api_version: v20111101
- api_version: v20250224
fail-fast: false
if: needs.check-skip-publish.outputs.skip_publish == 'false' && contains(github.event.head_commit.modified, matrix.version.api_version)
uses: ./.github/workflows/release.yml
with:
version_directory: ${{ matrix.version.api_version }}
secrets: inherit