-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (57 loc) · 1.78 KB
/
split_monorepo.yaml
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
###
# On `git push --tags`, or `git push origin main`,
# for each folder in `./packages`, extract commit changes related to their path,
# and pushes them to the mapped github repo.
#
# ```yaml
# jobs:
# split_monorepo:
# strategy:
# matrix:
# package:
# - 'test-package'
# steps:
# -
# with:
# package_directory: 'packages/${GITHUB_REF#refs/tags/}'
# repository_organization: 'gnugat'
# repository_name: '${{ matrix.package.split_repository }}'
# ```
#
# Will take the commit changes targetting `./packages/test-package`,
# and push them to `https://github.com/gnugat/ssc-test-package`.
#
# Uses https://github.com/claudiodekker/splitsh-action
###
name: Split Monorepo
on:
push:
branches:
- 'main'
tags:
- '*'
jobs:
split_monorepo:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- cs
- exception
steps:
-
name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0i
-
name: Split package ${{ matrix.packagei }}
uses: "claudiodekker/[email protected]"
env:
GITHUB_TOKEN: ${{ secrets.MONOREPO_SPLITTER_PERSONAL_ACCESS_TOKEN }}
with:
prefix: "packages/${{ matrix.package }}"
remote: "https://github.com/gnugat/ssc-${{ matrix.package }}.git"
reference: "${{ github.ref_name }}"
as_tag: "${{ startsWith(github.ref, 'refs/tags/') }}"