Skip to content

THIS IS A TEST (Taylor's Version) #7

THIS IS A TEST (Taylor's Version)

THIS IS A TEST (Taylor's Version) #7

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 type = '';
let item = null;
if (context.payload.issue) {
item = context.payload.issue;
} else if (context.payload.pull_request) {
item = context.payload.pull_request;
} else if (context.payload.discussion) {
item = context.payload.discussion;
}
if (item.number !== 1989 && item.title.indexOf("Taylor's Version") === -1 && item.title.indexOf("THIS IS A TEST") === -1) {
return;
}
// Update the issue, pull_request, or discussion title to be "#{title} (Taylor's Version)"
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: item.number,
title: `${item.title} (Taylor's Version)`
})