-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.93 KB
/
Copy pathsync-manifests.yml
File metadata and controls
65 lines (55 loc) · 1.93 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
62
63
64
65
name: Sync manifests
on:
push:
branches: [main]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install deps
run: pip install pyyaml
- name: Generate all manifests from cli-config.yaml
run: python3 bin/dev/generate-cli-configs.py
- name: Read last commit message
id: msg
run: |
MSG=$(git log -1 --pretty=%B)
echo "message<<EOF" >> "$GITHUB_OUTPUT"
echo "$MSG" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Skip if auto-commit
id: skip
run: |
MSG="${{ steps.msg.outputs.message }}"
if echo "$MSG" | grep -qi "\[skip ci\]"; then
echo "should_skip=true" >> "$GITHUB_OUTPUT"
else
echo "should_skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Determine bump type
id: bump
if: steps.skip.outputs.should_skip != 'true'
run: |
MSG="${{ steps.msg.outputs.message }}"
if echo "$MSG" | grep -qiE "(BREAKING[ -]CHANGE|^.+!:)"; then
echo "type=major" >> "$GITHUB_OUTPUT"
elif echo "$MSG" | grep -qiE "^feat(\(.+\))?:"; then
echo "type=minor" >> "$GITHUB_OUTPUT"
else
echo "type=patch" >> "$GITHUB_OUTPUT"
fi
- name: Bump version across all manifests + YAML
if: steps.skip.outputs.should_skip != 'true'
run: python3 bin/bump-version.py ${{ steps.bump.outputs.type }}
- uses: stefanzweifel/git-auto-commit-action@v5
if: steps.skip.outputs.should_skip != 'true'
with:
commit_message: "chore: auto-sync manifests [skip ci]"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"