|
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 | permissions: |
17 | | - contents: write |
18 | | - pull-requests: write |
| 17 | + contents: write |
| 18 | + pull-requests: write |
19 | 19 |
|
20 | 20 | jobs: |
21 | | - generate: |
22 | | - runs-on: ubuntu-latest |
23 | | - steps: |
24 | | - - name: Checkout Javascript |
25 | | - uses: actions/checkout@v6.0.2 |
26 | | - - name: Setup Node |
27 | | - uses: actions/setup-node@v6 |
28 | | - with: |
29 | | - node-version: '20' |
30 | | - - name: Generate Openapi |
31 | | - run: | |
32 | | - echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }}" >> ./settings |
33 | | - echo "export GEN_COMMIT=${{ github.event.inputs.genCommit }}" >> ./settings |
34 | | - ./generate-client.sh |
35 | | - - name: Generate Branch Name |
36 | | - run: | |
37 | | - SUFFIX=$(openssl rand -hex 4) |
38 | | - echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV |
39 | | - - name: Commit and push |
40 | | - run: | |
41 | | - # Commit and push |
42 | | - git config user.email "k8s.ci.robot@gmail.com" |
43 | | - git config user.name "Kubernetes Prow Robot" |
44 | | - git checkout -b "$BRANCH" |
45 | | - git add . |
46 | | - # we modify the settings file in "Generate Openapi" but do not want to commit this |
47 | | - git reset settings |
48 | | - git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' |
49 | | - git push origin "$BRANCH" |
50 | | - - name: Pull Request |
51 | | - uses: repo-sync/pull-request@v2 |
52 | | - with: |
53 | | - source_branch: ${{ env.BRANCH }} |
54 | | - destination_branch: ${{ github.ref_name }} |
55 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
56 | | - pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}" |
| 21 | + generate: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - name: Checkout Javascript |
| 25 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 26 | + - name: Setup Node |
| 27 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 |
| 28 | + with: |
| 29 | + node-version: '20' |
| 30 | + - name: Generate Openapi |
| 31 | + run: | |
| 32 | + echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }}" >> ./settings |
| 33 | + echo "export GEN_COMMIT=${{ github.event.inputs.genCommit }}" >> ./settings |
| 34 | + ./generate-client.sh |
| 35 | + - name: Generate Branch Name |
| 36 | + run: | |
| 37 | + SUFFIX=$(openssl rand -hex 4) |
| 38 | + echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV |
| 39 | + - name: Commit and push |
| 40 | + run: | |
| 41 | + # Commit and push |
| 42 | + git config user.email "k8s.ci.robot@gmail.com" |
| 43 | + git config user.name "Kubernetes Prow Robot" |
| 44 | + git checkout -b "$BRANCH" |
| 45 | + git add . |
| 46 | + # we modify the settings file in "Generate Openapi" but do not want to commit this |
| 47 | + git reset settings |
| 48 | + git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' |
| 49 | + git push origin "$BRANCH" |
| 50 | + - name: Pull Request |
| 51 | + uses: repo-sync/pull-request@7e79a9f5dc3ad0ce53138f01df2fad14a04831c5 # v2.12.1 |
| 52 | + with: |
| 53 | + source_branch: ${{ env.BRANCH }} |
| 54 | + destination_branch: ${{ github.ref_name }} |
| 55 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + pr_title: 'Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}' |
0 commit comments