mirror of
https://github.com/morpheusthewhite/spicetify-themes.git
synced 2024-11-21 18:32:45 +01:00
parent
02badb180c
commit
3bc4f4eb5a
54
.github/workflows/auto-assign.yml
vendored
54
.github/workflows/auto-assign.yml
vendored
@ -1,54 +0,0 @@
|
|||||||
name: Theme Assigner
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened, edited]
|
|
||||||
pull_request:
|
|
||||||
types: [opened, edited]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
assign:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
script: |
|
|
||||||
const keywordsToAssigneesMap = {
|
|
||||||
BurntSienna: ["pjaspinski"],
|
|
||||||
Default: ["Blacksuan19"],
|
|
||||||
Dreary: ["CharlieS1103"],
|
|
||||||
Dribbblish: ["khanhas"],
|
|
||||||
Glaze: ["CharlieS1103"],
|
|
||||||
Onepunch: ["okarin001"],
|
|
||||||
Sleek: ["harbassan"],
|
|
||||||
Turntable: ["grasonchan"],
|
|
||||||
Ziro: ["schnensch0"],
|
|
||||||
Flow: ["ian-Liaozy", "Ruixi-Zhang"],
|
|
||||||
Matte: ["darkthemer"],
|
|
||||||
Blossom: ["Robatortas"],
|
|
||||||
Nightlight: ["iTenerai"],
|
|
||||||
};
|
|
||||||
|
|
||||||
const issue = await github.rest.issues.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
});
|
|
||||||
|
|
||||||
const title = issue.data.title;
|
|
||||||
const body = issue.data.body;
|
|
||||||
|
|
||||||
const assignees = [];
|
|
||||||
|
|
||||||
for (const [keyword, assignee] of Object.entries(keywordsToAssigneesMap)) {
|
|
||||||
if (title.match(new RegExp(`\\b${keyword}\\b`, "i")) || body.match(new RegExp(`\\b${keyword}\\b`, "i"))) {
|
|
||||||
assignees.push(...assignee);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await github.rest.issues.addAssignees({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
assignees: assignees,
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user