Skip to content

Commit f4d2920

Browse files
committed
Add support for custom structures in GitHub Actions workflow
1 parent e3f7e78 commit f4d2920

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

.github/workflows/struct-generate.yaml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ on:
4343
type: string
4444
required: false
4545
default: 'ubuntu-latest'
46+
custom_structure_repository:
47+
description: 'Path to the custom structures repository'
48+
type: string
49+
required: false
50+
default: ''
4651
secrets:
4752
token:
4853
description: 'GitHub token'
@@ -65,11 +70,33 @@ jobs:
6570
pip install git+https://github.com/httpdss/struct.git
6671
struct -h
6772
73+
- name: Install custom structures
74+
if: ${{ inputs.custom_structure_repository != '' }}
75+
uses: actions/checkout@v4
76+
with:
77+
repository: ${{ inputs.custom_structure_repository }}
78+
token: ${{ secrets.token }}
79+
path: ./custom-structures
80+
6881
- name: Run STRUCT
6982
run: |
70-
struct generate ${{ inputs.args }} \
71-
${{ inputs.struct_file }} \
72-
${{ inputs.output_dir }}
83+
if [ -d ./custom-structures ]; then
84+
85+
struct list \
86+
-s ./custom-structures
87+
88+
struct generate \
89+
-s ./custom-structures \
90+
${{ inputs.args }} \
91+
${{ inputs.struct_file }} \
92+
${{ inputs.output_dir }} \
93+
else
94+
struct list
95+
96+
struct generate ${{ inputs.args }} \
97+
${{ inputs.struct_file }} \
98+
${{ inputs.output_dir }}
99+
fi
73100
74101
- name: Generate PR with changes
75102
if: github.event_name == 'workflow_dispatch'

0 commit comments

Comments
 (0)