|
1 | 1 | name: Generate
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - workflow_dispatch: |
5 |
| - inputs: |
6 |
| - kubernetesBranch: |
7 |
| - type: string |
8 |
| - required: true |
9 |
| - description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"' |
10 |
| - genCommit: |
11 |
| - type: string |
12 |
| - required: true |
13 |
| - default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6' |
14 |
| - description: 'The commit to use for the kubernetes-client/gen repo' |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + kubernetesBranch: |
| 7 | + type: string |
| 8 | + required: true |
| 9 | + description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"' |
| 10 | + genCommit: |
| 11 | + type: string |
| 12 | + required: true |
| 13 | + default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6' |
| 14 | + description: 'The commit to use for the kubernetes-client/gen repo' |
| 15 | + |
15 | 16 |
|
16 | 17 | jobs:
|
17 |
| - generate: |
18 |
| - runs-on: ubuntu-latest |
19 |
| - steps: |
20 |
| - - name: Checkout Javascript |
21 |
| - |
22 |
| - - name: Setup Node |
23 |
| - uses: actions/setup-node@v5 |
24 |
| - with: |
25 |
| - node-version: '20' |
26 |
| - - name: Generate Openapi |
27 |
| - run: | |
28 |
| - echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }} >> ./settings" |
29 |
| - echo "export GEN_COMMIT="${{ github.event.inputs.genCommit }}" >> ./settings" |
30 |
| - ./generate-client.sh |
31 |
| - - name: Generate Branch Name |
32 |
| - run: | |
33 |
| - SUFFIX=$(openssl rand -hex 4) |
34 |
| - echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV |
35 |
| - - name: Commit and push |
36 |
| - run: | |
37 |
| - # Commit and push |
38 |
| - git config user.email "[email protected]" |
39 |
| - git config user.name "Kubernetes Prow Robot" |
40 |
| - git checkout -b "$BRANCH" |
41 |
| - git add . |
42 |
| - # we modify the settings file in "Generate Openapi" but do not want to commit this |
43 |
| - git reset settings |
44 |
| - git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' |
45 |
| - git push origin "$BRANCH" |
46 |
| - - name: Pull Request |
47 |
| - uses: repo-sync/pull-request@v2 |
48 |
| - with: |
49 |
| - source_branch: ${{ env.BRANCH }} |
50 |
| - destination_branch: ${{ github.ref_name }} |
51 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
52 |
| - pr_title: 'Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}' |
| 18 | + generate: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout Javascript |
| 22 | + |
| 23 | + - name: Setup Node |
| 24 | + uses: actions/setup-node@v5 |
| 25 | + with: |
| 26 | + node-version: '20' |
| 27 | + - name: Generate Openapi |
| 28 | + run: | |
| 29 | + echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }} >> ./settings" |
| 30 | + echo "export GEN_COMMIT="${{ github.event.inputs.genCommit }}" >> ./settings" |
| 31 | + ./generate-client.sh |
| 32 | + - name: Generate Branch Name |
| 33 | + run: | |
| 34 | + SUFFIX=$(openssl rand -hex 4) |
| 35 | + echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV |
| 36 | + - name: Commit and push |
| 37 | + run: | |
| 38 | + # Commit and push |
| 39 | + git config user.email "[email protected]" |
| 40 | + git config user.name "Kubernetes Prow Robot" |
| 41 | + git checkout -b "$BRANCH" |
| 42 | + git add . |
| 43 | + # we modify the settings file in "Generate Openapi" but do not want to commit this |
| 44 | + git reset settings |
| 45 | + git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' |
| 46 | + git push origin "$BRANCH" |
| 47 | + - name: Pull Request |
| 48 | + uses: repo-sync/pull-request@v2 |
| 49 | + with: |
| 50 | + source_branch: ${{ env.BRANCH }} |
| 51 | + destination_branch: ${{ github.ref_name }} |
| 52 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}" |
0 commit comments