From 2c098fdfedc98c0fbac3f131ef124f1276fb5d43 Mon Sep 17 00:00:00 2001 From: Yuta Matsumura Date: Tue, 18 Jul 2023 23:40:02 +0900 Subject: [PATCH] update github-pull-request-creation.yml --- .github/workflows/github-pull-request-creation.yml | 5 +++-- .github/workflows/github-repository-commit.yml | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-pull-request-creation.yml b/.github/workflows/github-pull-request-creation.yml index 7056f6e..73c8fdf 100644 --- a/.github/workflows/github-pull-request-creation.yml +++ b/.github/workflows/github-pull-request-creation.yml @@ -9,6 +9,7 @@ on: type: string env: + BRANCH: ${{ inputs.branch-name }} TITLE: "PR from ${{ inputs.branch-name }}" jobs: @@ -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: diff --git a/.github/workflows/github-repository-commit.yml b/.github/workflows/github-repository-commit.yml index 385a547..d60e2b4 100644 --- a/.github/workflows/github-repository-commit.yml +++ b/.github/workflows/github-repository-commit.yml @@ -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 @@ -30,6 +33,8 @@ 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: @@ -37,4 +42,4 @@ jobs: 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 }}