Skip to content

Commit 8d1d11f

Browse files
recursivezeroxkeshav
authored andcommitted
Update issue-template-number.yml
fix syntx and also added labeled types
1 parent aa6a986 commit 8d1d11f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/issue-template-number.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Auto Replace X in Issue Title"
22

33
on:
44
issues:
5-
types: [opened, labeled]
5+
types: [opened,labeled]
66
permissions:
77
issues: write
88

@@ -17,9 +17,11 @@ jobs:
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 }}"

0 commit comments

Comments
 (0)