File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 2525 branch_name=$(echo "${{ github.event.inputs.name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
2626 echo "Branch name: ${branch_name}"
2727 git checkout -b "$branch_name"
28- git commit --allow-empty -m "create PR from branch ${branch_name}"
28+
29+ # Create the draft item
30+ touch drafts/${branch_name}
31+ git add drafts
32+ git commit -m "create PR from branch ${branch_name}"
33+
2934 git push origin "$branch_name"
3035 echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
3136
Original file line number Diff line number Diff line change @@ -18,11 +18,15 @@ jobs:
1818 id : create_post
1919 run : |
2020 PR_TITLE=${{ github.event.pull_request.title }}
21- PR_TITLE=${PR_TITLE#post/}
21+ DRAFT_TITLE=${PR_TITLE#post/}
22+
23+ # Remove the draft item
24+ git rm drafts/${DRAFT_TITLE}
25+
2226 DATE=$(date +'%Y-%m-%d')
23- PR_TITLE ="${DATE}-${PR_TITLE }"
27+ POST_TITLE ="${DATE}-${DRAFT_TITLE }"
2428 PR_BODY=${{ github.event.pull_request.body }}
25- POST_FILE="posts/${PR_TITLE }.md"
29+ POST_FILE="posts/${POST_TITLE }.md"
2630 echo "${PR_BODY}" >> $POST_FILE
2731
2832 - name : Commit and push changes
You can’t perform that action at this time.
0 commit comments