diff --git a/.github/workflows/make-it-taylors-version.yml b/.github/workflows/make-it-taylors-version.yml new file mode 100644 index 0000000..d96f60f --- /dev/null +++ b/.github/workflows/make-it-taylors-version.yml @@ -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)` + }) \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d4f4387 --- /dev/null +++ b/README.md @@ -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. \ No newline at end of file