From b091fd8c7c237890f2acc94d1d9af1f19d7d8b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Str=C3=BCbing?= Date: Thu, 18 Dec 2025 02:34:59 +0100 Subject: [PATCH 1/3] ci: set contents and pull-requests write permissions for gen javascript --- .github/workflows/generate-javascript.yml | 97 ++++++++++++----------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/.github/workflows/generate-javascript.yml b/.github/workflows/generate-javascript.yml index e3bdfb9244..c733fb5a72 100644 --- a/.github/workflows/generate-javascript.yml +++ b/.github/workflows/generate-javascript.yml @@ -1,53 +1,56 @@ name: Generate on: - workflow_dispatch: - inputs: - kubernetesBranch: - type: string - required: true - description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"' - genCommit: - type: string - required: true - default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6' - description: 'The commit to use for the kubernetes-client/gen repo' + workflow_dispatch: + inputs: + kubernetesBranch: + type: string + required: true + description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"' + genCommit: + type: string + required: true + default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6' + description: 'The commit to use for the kubernetes-client/gen repo' +permissions: + contents: write + pull-requests: write jobs: - generate: - runs-on: ubuntu-latest - steps: - - name: Checkout Javascript - uses: actions/checkout@v6.0.1 - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: '20' - - name: Generate Openapi - run: | - echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }}" >> ./settings - echo "export GEN_COMMIT=${{ github.event.inputs.genCommit }}" >> ./settings - ./generate-client.sh - - name: Generate Branch Name - run: | - SUFFIX=$(openssl rand -hex 4) - echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV - - name: Commit and push - run: | - # Commit and push - git config user.email "k8s.ci.robot@gmail.com" - git config user.name "Kubernetes Prow Robot" - git checkout -b "$BRANCH" - git add . - # we modify the settings file in "Generate Openapi" but do not want to commit this - git reset settings - git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' - git push origin "$BRANCH" - - name: Pull Request - uses: repo-sync/pull-request@v2 - with: - source_branch: ${{ env.BRANCH }} - destination_branch: ${{ github.ref_name }} - github_token: ${{ secrets.GITHUB_TOKEN }} - pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}" + generate: + runs-on: ubuntu-latest + steps: + - name: Checkout Javascript + uses: actions/checkout@v6.0.1 + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: '20' + - name: Generate Openapi + run: | + echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }}" >> ./settings + echo "export GEN_COMMIT=${{ github.event.inputs.genCommit }}" >> ./settings + ./generate-client.sh + - name: Generate Branch Name + run: | + SUFFIX=$(openssl rand -hex 4) + echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV + - name: Commit and push + run: | + # Commit and push + git config user.email "k8s.ci.robot@gmail.com" + git config user.name "Kubernetes Prow Robot" + git checkout -b "$BRANCH" + git add . + # we modify the settings file in "Generate Openapi" but do not want to commit this + git reset settings + git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' + git push origin "$BRANCH" + - name: Pull Request + uses: repo-sync/pull-request@v2 + with: + source_branch: ${{ env.BRANCH }} + destination_branch: ${{ github.ref_name }} + github_token: ${{ secrets.GITHUB_TOKEN }} + pr_title: 'Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}' From 6870aef3ebc2e52ee5781508c0c6eb2d2c1b77b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Str=C3=BCbing?= Date: Thu, 18 Dec 2025 19:33:46 +0100 Subject: [PATCH 2/3] chore: revert whitespace changes From 1cf71eb010dfdc539ac644534ae018c6a60537eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Str=C3=BCbing?= Date: Thu, 18 Dec 2025 19:38:24 +0100 Subject: [PATCH 3/3] chore: revert whitespace changes --- .github/workflows/generate-javascript.yml | 98 +++++++++++------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/generate-javascript.yml b/.github/workflows/generate-javascript.yml index c733fb5a72..1859158e14 100644 --- a/.github/workflows/generate-javascript.yml +++ b/.github/workflows/generate-javascript.yml @@ -1,56 +1,56 @@ name: Generate on: - workflow_dispatch: - inputs: - kubernetesBranch: - type: string - required: true - description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"' - genCommit: - type: string - required: true - default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6' - description: 'The commit to use for the kubernetes-client/gen repo' + workflow_dispatch: + inputs: + kubernetesBranch: + type: string + required: true + description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"' + genCommit: + type: string + required: true + default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6' + description: 'The commit to use for the kubernetes-client/gen repo' permissions: - contents: write - pull-requests: write + contents: write + pull-requests: write jobs: - generate: - runs-on: ubuntu-latest - steps: - - name: Checkout Javascript - uses: actions/checkout@v6.0.1 - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: '20' - - name: Generate Openapi - run: | - echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }}" >> ./settings - echo "export GEN_COMMIT=${{ github.event.inputs.genCommit }}" >> ./settings - ./generate-client.sh - - name: Generate Branch Name - run: | - SUFFIX=$(openssl rand -hex 4) - echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV - - name: Commit and push - run: | - # Commit and push - git config user.email "k8s.ci.robot@gmail.com" - git config user.name "Kubernetes Prow Robot" - git checkout -b "$BRANCH" - git add . - # we modify the settings file in "Generate Openapi" but do not want to commit this - git reset settings - git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' - git push origin "$BRANCH" - - name: Pull Request - uses: repo-sync/pull-request@v2 - with: - source_branch: ${{ env.BRANCH }} - destination_branch: ${{ github.ref_name }} - github_token: ${{ secrets.GITHUB_TOKEN }} - pr_title: 'Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}' + generate: + runs-on: ubuntu-latest + steps: + - name: Checkout Javascript + uses: actions/checkout@v6.0.1 + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: '20' + - name: Generate Openapi + run: | + echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }}" >> ./settings + echo "export GEN_COMMIT=${{ github.event.inputs.genCommit }}" >> ./settings + ./generate-client.sh + - name: Generate Branch Name + run: | + SUFFIX=$(openssl rand -hex 4) + echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV + - name: Commit and push + run: | + # Commit and push + git config user.email "k8s.ci.robot@gmail.com" + git config user.name "Kubernetes Prow Robot" + git checkout -b "$BRANCH" + git add . + # we modify the settings file in "Generate Openapi" but do not want to commit this + git reset settings + git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}' + git push origin "$BRANCH" + - name: Pull Request + uses: repo-sync/pull-request@v2 + with: + source_branch: ${{ env.BRANCH }} + destination_branch: ${{ github.ref_name }} + github_token: ${{ secrets.GITHUB_TOKEN }} + pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}"