Skip to content

Commit 4dd19ad

Browse files
authored
Merge pull request #19 from secretary/fix/workflow-dispatch-split
feat(ci): add workflow_dispatch trigger to split workflow
2 parents 1333ce8 + 092df80 commit 4dd19ad

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/split.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ name: Split Monorepo
99
# The default GITHUB_TOKEN cannot push to other repositories.
1010

1111
on:
12+
workflow_dispatch:
1213
push:
1314
tags:
1415
- '*'
@@ -46,6 +47,17 @@ jobs:
4647
with:
4748
fetch-depth: 0
4849

50+
- name: Determine tag
51+
id: tag
52+
run: |
53+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
54+
TAG=$(git describe --tags --abbrev=0)
55+
else
56+
TAG="${{ github.ref_name }}"
57+
fi
58+
echo "name=$TAG" >> $GITHUB_OUTPUT
59+
echo "Using tag: $TAG"
60+
4961
- name: Split ${{ matrix.package.split_repository }}
5062
uses: symplify/monorepo-split-github-action@v2.3.0
5163
with:
@@ -54,7 +66,7 @@ jobs:
5466
repository_name: ${{ matrix.package.split_repository }}
5567
user_name: 'github-actions[bot]'
5668
user_email: 'github-actions[bot]@users.noreply.github.com'
57-
tag: ${{ github.ref_name }}
69+
tag: ${{ steps.tag.outputs.name }}
5870
branch: 'master'
5971
env:
6072
GITHUB_TOKEN: ${{ secrets.SPLIT_TOKEN }}

0 commit comments

Comments
 (0)