Skip to content

Commit

Permalink
add github-pull-request-creation.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubakimoto authored Jul 17, 2023
1 parent d812c34 commit 4d83dcb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/github-pull-request-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: GitHub pull request creation

on:
workflow_call:
inputs:
branch:
description: "Branch name"
required: true
type: string

env:
PR_TITLE: "PR from ${{ inputs.branch }}"

jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Create a pull request
run: |
gh pr create \
--base ${{ inputs.branch }} \
--title $PR_TITLE \
--body ""
8 changes: 7 additions & 1 deletion .github/workflows/github-repository-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: GitHub repository commit
on:
workflow_dispatch:

env:
BRANCH: content-${{ github.run_id }}

permissions:
contents: write

Expand All @@ -20,7 +23,6 @@ jobs:
run: |
echo -e "\n" >> README.md
date >> README.md
BRANCH=content-${{ github.run_id }}
git checkout -b $BRANCH
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
Expand All @@ -30,3 +32,7 @@ jobs:
git checkout main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create a pull request
uses: tsubakimoto/github-actions-samples/.github/workflows/github-pull-request-creation.yml@main
with:
branch: $BRANCH

0 comments on commit 4d83dcb

Please sign in to comment.