THIS IS A TEST #4
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
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.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: item.number, | |
title: `${item.title} (Taylor's Version)` | |
}) |