Skip to content

Commit 1d8f853

Browse files
authored
Merge pull request #54 from IShix-g/release
feat: add trigger check for workflow_dispatch
2 parents 0bbe007 + 706c29c commit 1d8f853

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/build-toc-generator.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,22 @@ permissions:
1313
contents: write
1414

1515
jobs:
16+
check-trigger:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- name: Check if trigger is workflow_dispatch
20+
id: check_trigger
21+
run: |
22+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
23+
echo "::notice::Trigger is workflow_dispatch"
24+
echo "checked=1" >> $GITHUB_OUTPUT
25+
else
26+
echo "::notice::Trigger is not workflow_dispatch"
27+
fi
28+
1629
check-last-commit-tag:
30+
needs: [check-trigger]
31+
if: ${{ needs.check-trigger.outputs.checked != '1' }}
1732
runs-on: ubuntu-22.04
1833
outputs:
1934
tagged: ${{ steps.check_tag.outputs.tagged }}
@@ -35,9 +50,9 @@ jobs:
3550
fi
3651
3752
toc-generator:
38-
needs: [check-last-commit-tag]
53+
needs: [check-trigger, check-last-commit-tag]
3954
uses: IShix-g/Unity-GitHubActions/.github/workflows/reusable-toc-generator.yaml@main
40-
if: ${{ needs.check-last-commit-tag.outputs.tagged == '1' }}
55+
if: ${{ needs.check-trigger.outputs.checked == '1' || needs.check-last-commit-tag.outputs.tagged == '1' }}
4156
secrets:
4257
BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
4358
BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}

0 commit comments

Comments
 (0)