Skip to content

Commit 3353fcf

Browse files
Add some conditional flags.
1 parent a2a3ee1 commit 3353fcf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/generate.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ on:
77
type: string
88
required: true
99
description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"'
10-
10+
dry_run:
11+
type: boolean
12+
required: true
13+
default: false
14+
description: Dry run, will not send a PR
15+
skip_patches:
16+
type: boolean
17+
required: true
18+
default: false
19+
description: If true, skip patching code after generation
1120

1221
permissions:
1322
contents: read
@@ -68,6 +77,7 @@ jobs:
6877
git add .
6978
git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}'
7079
- name: Apply Manual Diffs
80+
if: ${{ github.event.inputs.skip_patches != 'true' }}
7181
run: |
7282
ls scripts/patches/*.diff | xargs git apply
7383
git add .
@@ -87,12 +97,14 @@ jobs:
8797
run: |
8898
mvn spotless:apply
8999
- name: Commit and push
100+
if: ${{ github.event.inputs.dry_run != 'true' }}
90101
run: |
91102
# Commit and push
92103
git add .
93104
git commit -s -m 'Format and fluent-gen from ${{ github.event.inputs.kubernetesBranch }}'
94105
git push origin "$BRANCH"
95106
- name: Pull Request
107+
if: ${{ github.event.inputs.dry_run != 'true' }}
96108
uses: repo-sync/pull-request@v2
97109
with:
98110
source_branch: ${{ env.BRANCH }}

0 commit comments

Comments
 (0)