Skip to content

Commit f241086

Browse files
authored
Update START_DATE in auto-pr-title.yml
1 parent f5ed676 commit f241086

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Auto PR Title
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
set-pr-title:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Set PR title
16+
env:
17+
GH_TOKEN: ${{ github.token }}
18+
PR_NUMBER: ${{ github.event.pull_request.number }}
19+
BRANCH_NAME: ${{ github.head_ref }}
20+
TZ: Asia/Seoul
21+
run: |
22+
START_DATE="2026-07-30"
23+
24+
TODAY=$(date +"%Y-%m-%d")
25+
26+
START_SECONDS=$(date -d "$START_DATE" +%s)
27+
TODAY_SECONDS=$(date -d "$TODAY" +%s)
28+
29+
DIFF_DAYS=$(( (TODAY_SECONDS - START_SECONDS) / 86400 + 1 ))
30+
DAY=$(printf "%02d" "$DIFF_DAYS")
31+
32+
TITLE="[$BRANCH_NAME] Day$DAY"
33+
34+
echo "PR title: $TITLE"
35+
36+
gh pr edit "$PR_NUMBER" --title "$TITLE"

0 commit comments

Comments
 (0)