Skip to content

Commit d11f925

Browse files
CopilotHackingGate
andcommitted
Add manual workflow trigger with OS selection support
Co-authored-by: HackingGate <8541644+HackingGate@users.noreply.github.com>
1 parent fe84f98 commit d11f925

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/test_typst_out_action.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ on:
77
pull_request:
88
branches:
99
- main
10+
workflow_dispatch:
11+
inputs:
12+
os:
13+
description: 'Operating System(s) to test on'
14+
required: false
15+
type: choice
16+
default: 'all'
17+
options:
18+
- 'all'
19+
- 'ubuntu-latest'
20+
- 'macos-latest'
21+
- 'windows-latest'
22+
typst_version:
23+
description: 'Typst version to test (leave empty for all versions)'
24+
required: false
25+
type: string
1026

1127
permissions:
1228
contents: read
@@ -52,6 +68,28 @@ jobs:
5268
# Parse the TYPST_VERSIONS array
5369
ALL_VERSIONS='${{ env.TYPST_VERSIONS }}'
5470
71+
# Handle manual workflow_dispatch
72+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
73+
echo "Manual workflow dispatch detected"
74+
75+
# Handle OS selection
76+
if [ "${{ github.event.inputs.os }}" == "all" ] || [ -z "${{ github.event.inputs.os }}" ]; then
77+
echo 'os-matrix=["ubuntu-latest", "macos-latest", "windows-latest"]' >> $GITHUB_OUTPUT
78+
else
79+
echo 'os-matrix=["${{ github.event.inputs.os }}"]' >> $GITHUB_OUTPUT
80+
fi
81+
82+
# Handle typst version selection
83+
if [ -n "${{ github.event.inputs.typst_version }}" ]; then
84+
echo 'typst-version-matrix=["${{ github.event.inputs.typst_version }}"]' >> $GITHUB_OUTPUT
85+
else
86+
# Use all versions from TYPST_VERSIONS
87+
echo "typst-version-matrix=$ALL_VERSIONS" >> $GITHUB_OUTPUT
88+
fi
89+
90+
exit 0
91+
fi
92+
5593
if [ "${{ steps.filter.outputs.workflow }}" == "true" ]; then
5694
# Check if this is a PR or push event
5795
if [ "${{ github.event_name }}" == "pull_request" ]; then

0 commit comments

Comments
 (0)