@@ -20,10 +20,12 @@ jobs:
2020 runs-on : ubuntu-latest
2121 permissions :
2222 contents : write # Push generated branch
23- pull-requests : write # Create PR via repo-sync/pull-request
23+ pull-requests : write # Create PR via gh CLI
2424 steps :
2525 - name : Checkout Javascript
2626 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+ with :
28+ persist-credentials : false
2729 - name : Setup Node
2830 uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
2931 with :
@@ -50,13 +52,19 @@ jobs:
5052 # we modify the settings file in "Generate Openapi" but do not want to commit this
5153 git reset settings
5254 git commit -s -m "Automated openapi generation from ${KUBERNETES_BRANCH}"
55+ git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
5356 git push origin "$BRANCH"
5457 env :
5558 KUBERNETES_BRANCH : ${{ github.event.inputs.kubernetesBranch }}
56- - name : Pull Request
57- uses : repo-sync/pull-request@7e79a9f5dc3ad0ce53138f01df2fad14a04831c5 # v2.12.1
58- with :
59- source_branch : ${{ env.BRANCH }}
60- destination_branch : ${{ github.ref_name }}
61- github_token : ${{ secrets.GITHUB_TOKEN }}
62- pr_title : ' Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}'
59+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60+ - name : Create Pull Request
61+ run : |
62+ gh pr create \
63+ --base "${BASE_BRANCH}" \
64+ --head "$BRANCH" \
65+ --title "Automated Generate from openapi ${KUBERNETES_BRANCH}" \
66+ --body "Automated openapi generation from ${KUBERNETES_BRANCH}"
67+ env :
68+ KUBERNETES_BRANCH : ${{ github.event.inputs.kubernetesBranch }}
69+ BASE_BRANCH : ${{ github.ref_name }}
70+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments