-
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.07 KB
/
create-pr-code-owner.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Create PR (for code owner)
on:
workflow_dispatch:
env:
base-branch: "main"
reviewers: "noritakaIzumi"
jobs:
create-pr:
name: Create a PR
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.REPOSITORY_APP_ID }}
private-key: ${{ secrets.REPOSITORY_APP_PRIVATE_KEY }}
- name: Create PR (after clean)
working-directory: .github
run: |
gh pr close ${{ github.event.ref }} --comment "This PR is deprecated." || true
gh pr create \
--base ${{ env.base-branch }} \
--head ${{ github.event.ref }} \
--title ${{ github.event.ref }} \
--body-file "pull_request_template.md" \
--reviewer ${{ env.reviewers }} \
--assignee ${{ github.actor }} \
--draft
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}