Skip to content

Commit

Permalink
update github-pull-request-creation.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubakimoto committed Jul 18, 2023
1 parent 9467da1 commit 2c098fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/github-pull-request-creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
type: string

env:
BRANCH: ${{ inputs.branch-name }}
TITLE: "PR from ${{ inputs.branch-name }}"

jobs:
Expand All @@ -18,13 +19,13 @@ jobs:
- name: Dump parameters
run: |
echo "**branch name**"
echo ${{ inputs.branch-name }}
echo "$BRANCH"
echo "**title**"
echo $TITLE
- name: Create a pull request
run: |
gh pr create \
--base ${{ inputs.branch-name }} \
--base "$BRANCH" \
--title "$TITLE" \
--body ""
env:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/github-repository-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ jobs:
commit-on-branch:
name: Commit a new file
runs-on: ubuntu-latest
outputs:
branch-name: ${{ steps.commit-step.outputs.branch-name }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare a branch, and file
id: commit-step
run: |
echo -e "\n" >> README.md
date >> README.md
Expand All @@ -30,11 +33,13 @@ jobs:
git commit -m "Add date to README.md"
git push --set-upstream origin $BRANCH
git checkout main
echo "branch-name: $BRANCH"
echo "branch-name=$BRANCH" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
call-pull-request-workflow:
name: Call pull request workflow
needs: commit-on-branch
uses: ./.github/workflows/github-pull-request-creation.yml
with:
branch-name: $BRANCH
branch-name: ${{ needs.commit-on-branch.outputs.branch-name }}

0 comments on commit 2c098fd

Please sign in to comment.