-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a405a7a
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Make it Taylor's Version | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
discussions: write | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
pull_request: | ||
types: | ||
- opened | ||
discussion: | ||
types: | ||
- created | ||
|
||
jobs: | ||
add-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
let number = -1; | ||
let type = ''; | ||
if (context.payload.issue) { | ||
number = context.payload.issue.number; | ||
type = "issue" | ||
} else if (context.payload.pull_request) { | ||
number = context.payload.pull_request.number; | ||
type = "pull_request" | ||
} else if (context.payload.discussion) { | ||
number = context.payload.discussion.number; | ||
type = "discussion" | ||
} | ||
if (number !== 1989){ | ||
return; | ||
} | ||
// Update the issue, pull_request, or discussion title to be "#{title} (Taylor's Version)" | ||
github.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: number, | ||
title: `${context.payload[type].title} (Taylor's Version)` | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Make it Taylor's Version | ||
|
||
GitHub Action to edit any Issue, Pull Request, or Discussion title with the number 1989 from "Title" to "Title (Taylor's Version)." | ||
|
||
### FAQ | ||
|
||
**Is this a joke?** | ||
|
||
Yes. | ||
|
||
**But does it work?** | ||
|
||
I think so. |