File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Auto Replace X in Issue Title"
2+
3+ on :
4+ issues :
5+ types : [opened]
6+
7+ jobs :
8+ update_issue_title :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Replace 'X' with issue number
12+ env :
13+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
14+ run : |
15+ ISSUE_NUMBER=${{ github.event.issue.number }}
16+ OLD_TITLE="${{ github.event.issue.title }}"
17+
18+ # Replace 'X' with the actual issue number in the title
19+ NEW_TITLE=$(echo "$OLD_TITLE" | sed "s/X/$ISSUE_NUMBER/g")
20+
21+ # 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}\"}"
You can’t perform that action at this time.
0 commit comments