Skip to content

Commit 729106d

Browse files
chore: do not do the commit myself (#51)
1 parent c4e7027 commit 729106d

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

.github/workflows/create_new_post_pr.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,25 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919

20-
- name: Create new branch
21-
id: create_branch
20+
- name: Make draft item and get branch name
21+
id: get_name
2222
run: |
23-
git config --global user.name 'github-actions[bot]'
24-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
2523
branch_name=$(echo "${{ github.event.inputs.name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
26-
echo "Branch name: ${branch_name}"
27-
git checkout -b "$branch_name"
2824
29-
# Create the draft item
25+
# Create an item in drafts directory
3026
touch drafts/${branch_name}
3127
git add drafts
3228
git commit -m "create PR from branch ${branch_name}"
3329
34-
git push origin "$branch_name"
3530
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
3631
3732
- name: Create Pull Request
3833
id: create_pr
3934
uses: peter-evans/create-pull-request@v7
4035
with:
4136
token: ${{ secrets.GITHUB_TOKEN }}
42-
branch: ${{ steps.create_branch.outputs.branch_name }}
37+
branch: ${{ steps.get_name.outputs.branch_name }}
4338
base: main
44-
title: posts/${{ steps.create_branch.outputs.branch_name }}
39+
title: posts/${{ steps.get_name.outputs.branch_name }}
4540
body-path: '${{ github.workspace }}/.github/PULL_REQUEST_TEMPLATE/post.md'
4641
labels: 'post'

0 commit comments

Comments
 (0)