File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ name: "Auto Replace X in Issue Title"
33on :
44 issues :
55 types : [opened]
6-
6+ permissions :
7+ issues : write
8+
79jobs :
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 }}"
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
You can’t perform that action at this time.
0 commit comments