Skip to content

Commit 806c18d

Browse files
Update issue-template-number.yml
1 parent c23679d commit 806c18d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ name: "Auto Replace X in Issue Title"
33
on:
44
issues:
55
types: [opened]
6-
6+
permissions:
7+
issues: write
8+
79
jobs:
810
update_issue_title:
911
runs-on: ubuntu-latest
1012
steps:
1113
- name: Replace 'X' with issue number
1214
env:
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
GH_TOKEN: ${{ secrets.ISSUE_TOKEN }}
1416
run: |
1517
ISSUE_NUMBER=${{ github.event.issue.number }}
1618
OLD_TITLE="${{ github.event.issue.title }}"
@@ -19,7 +21,5 @@ jobs:
1921
NEW_TITLE=$(echo "$OLD_TITLE" | sed "s/X/$ISSUE_NUMBER/g")
2022
2123
# Update issue title using GitHub API
22-
curl -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
23-
-H "Accept: application/vnd.github.v3+json" \
24-
https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER} \
25-
-d "{\"title\": \"${NEW_TITLE}\"}"
24+
gh issue edit "$ISSUE_NUMBER" --title "$NEW_TITLE" --repo "${{ github.repository }}"
25+
shell: bash

0 commit comments

Comments
 (0)