@@ -2,6 +2,12 @@ name: split-monorepo
2
2
on :
3
3
release :
4
4
types : [published]
5
+ workflow_dispatch :
6
+ inputs :
7
+ tag :
8
+ description : ' Package tag'
9
+ type : string
10
+ required : true
5
11
6
12
jobs :
7
13
split-repositories :
@@ -21,21 +27,39 @@ jobs:
21
27
- [provider, split, Split]
22
28
- [provider, go-feature-flag, GoFeatureFlag]
23
29
steps :
30
+ - name : Detect run requirement
31
+ id : shouldRun
32
+ run : |
33
+ input_ref="${{ github.event.release.tag_name }}"
34
+ if [ -z "$input_ref" ]; then
35
+ input_ref="${{ inputs.tag }}"
36
+ fi
37
+ result=0
38
+ if [[ "$inputRef" == open-feature/${{ matrix.config[1] }}-${{ matrix.config[0] }}-* ]]; then
39
+ result=1
40
+ fi
41
+ echo "::set-output name=result::${result}"
24
42
- name : checkout
43
+ if : ${{ steps.shouldRun.outputs.result == '1' }}
25
44
run : |
26
45
git clone "$GITHUB_SERVER_URL"/"$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE"
27
46
cd "$GITHUB_WORKSPACE"
28
47
git checkout "$GITHUB_SHA"
29
48
- name : Replace string in GitHub Actions
49
+ if : ${{ steps.shouldRun.outputs.result == '1' }}
30
50
id : targetRef
31
51
run : |
32
52
input_ref="${{ github.event.release.tag_name }}"
53
+ if [ -z "$input_ref" ]; then
54
+ input_ref="${{ inputs.tag }}"
55
+ fi
33
56
if [ -n "$input_ref" ]; then
34
57
input_ref="refs/tags/$input_ref"
35
58
target_ref="$(echo -n "$input_ref"|sed 's#open-feature/${{ matrix.config[1] }}-${{ matrix.config[0] }}-##')"
36
59
fi
37
60
echo "::set-output name=result::${target_ref}"
38
- - name : filter-and-push-package-${{ matrix.config[1] }}-${{ matrix.config[0] }}
61
+ - name : Filter and push package ${{ matrix.config[1] }}-${{ matrix.config[0] }}
62
+ if : ${{ steps.shouldRun.outputs.result == '1' }}
39
63
40
64
with :
41
65
privateKey : ${{ secrets.SSH_PRIVATE_KEY }}
0 commit comments