From 1abd4cb90917ecf8cde0be008541551cabeabb9e Mon Sep 17 00:00:00 2001 From: Tsung-Ju Lii Date: Thu, 27 Feb 2025 20:50:39 +0800 Subject: [PATCH] chore: do not do the commit myself --- .github/workflows/create_new_post_pr.yaml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/create_new_post_pr.yaml b/.github/workflows/create_new_post_pr.yaml index e039d5b..d9e9111 100644 --- a/.github/workflows/create_new_post_pr.yaml +++ b/.github/workflows/create_new_post_pr.yaml @@ -17,21 +17,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Create new branch - id: create_branch + - name: Make draft item and get branch name + id: get_name run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' branch_name=$(echo "${{ github.event.inputs.name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') - echo "Branch name: ${branch_name}" - git checkout -b "$branch_name" - # Create the draft item + # Create an item in drafts directory touch drafts/${branch_name} git add drafts git commit -m "create PR from branch ${branch_name}" - git push origin "$branch_name" echo "branch_name=$branch_name" >> $GITHUB_OUTPUT - name: Create Pull Request @@ -39,8 +34,8 @@ jobs: uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ steps.create_branch.outputs.branch_name }} + branch: ${{ steps.get_name.outputs.branch_name }} base: main - title: posts/${{ steps.create_branch.outputs.branch_name }} + title: posts/${{ steps.get_name.outputs.branch_name }} body-path: '${{ github.workspace }}/.github/PULL_REQUEST_TEMPLATE/post.md' labels: 'post'