File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: "Auto Replace X in Issue Title"
22
33on :
44 issues :
5- types : [opened, labeled]
5+ types : [opened,labeled]
66permissions :
77 issues : write
88
1717 ISSUE_NUMBER=${{ github.event.issue.number }}
1818 OLD_TITLE="${{ github.event.issue.title }}"
1919
20- # Replace 'X' with the actual issue number in the title
21- PADDED_NUM=$(printf \"%04d\" \"$ISSUE_NUMBER\")
22- NEW_TITLE=$(echo \"$OLD_TITLE\" | sed \"s/000X/$PADDED_NUM/g\")
20+ # Pad the issue number to 4 digits (e.g., 1 -> 0001)
21+ PADDED_NUM=$(printf "%04d" "$ISSUE_NUMBER")
22+
23+ # Replace '000X' with the padded issue number in the title
24+ NEW_TITLE=$(echo "$OLD_TITLE" | sed "s/000X/$PADDED_NUM/g")
2325
2426 # Update issue title using GitHub API
2527 gh issue edit "$ISSUE_NUMBER" --title "$NEW_TITLE" --repo "${{ github.repository }}"
You can’t perform that action at this time.
0 commit comments