From 49f12c5364e5bb73722ef7ef3501af989e416393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E9=88=9E?= Date: Sun, 20 Oct 2024 15:43:14 +0800 Subject: [PATCH] ci: enhance auto PR creation with GH_TOKEN auth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update the job name from "pull-request" to "Create or Update Pull Request" - Add environment variable `GH_TOKEN` for GitHub token - Reformat the `gh_pr_up` function for better readability - Specify the shell to be used as bash for the `gh_pr_up` function Signed-off-by: 陳鈞 --- .github/workflows/AutoGenerator.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/AutoGenerator.yml b/.github/workflows/AutoGenerator.yml index 00ef5d5..8e097a3 100644 --- a/.github/workflows/AutoGenerator.yml +++ b/.github/workflows/AutoGenerator.yml @@ -45,7 +45,17 @@ jobs: with: ref: AutoGenerator - - name: pull-request + - name: Create or Update Pull Request + env: + GH_TOKEN: ${{ github.token }} run: | - gh_pr_up() { gh pr create $* || gh pr edit $* } - gh_pr_up --title "AutoGenerator to master auto PR" --body ":robot: Automated PR from **AutoGenerator** to **master**" --label automerge --base master --head AutoGenerator + gh_pr_up() { + gh pr create "$@" || gh pr edit "$@" + } + + gh_pr_up --title "AutoGenerator to master auto PR" \ + --body ":robot: Automated PR from **AutoGenerator** to **master**" \ + --label automerge \ + --base master \ + --head AutoGenerator + shell: bash