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'