Skip to content

Commit

Permalink
ci: enhance auto PR creation with GH_TOKEN auth
Browse files Browse the repository at this point in the history
- 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: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Oct 20, 2024
1 parent 21f52da commit 49f12c5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/AutoGenerator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 49f12c5

Please sign in to comment.