mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Switch to action to label maintainers, duh
This commit is contained in:
36
.github/workflows/on-open-handler.yml
vendored
36
.github/workflows/on-open-handler.yml
vendored
@@ -10,35 +10,15 @@ jobs:
|
|||||||
label-maintainer:
|
label-maintainer:
|
||||||
name: Label if Author is a Repo Maintainer
|
name: Label if Author is a Repo Maintainer
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: contains(fromJson('["Cohee1207", "RossAscends", "Wolfsblvt"]'), github.actor)
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Label if Author is a Repo Maintainer
|
- name: Label if Author is a Repo Maintainer
|
||||||
# GitHub Script
|
# 🤖 Issues Helper
|
||||||
# https://github.com/marketplace/actions/github-script
|
# https://github.com/marketplace/actions/issues-helper
|
||||||
uses: actions/github-script@v7
|
uses: actions-cool/issues-helper@v3
|
||||||
with:
|
with:
|
||||||
script: |
|
actions: 'add-labels'
|
||||||
const github = require('@actions/github');
|
token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
const core = require('@actions/core');
|
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
|
||||||
|
labels: '👷 Maintainer'
|
||||||
// Hard-coded list of maintainer usernames
|
|
||||||
const maintainers = ['Cohee1207', 'RossAscends', 'Wolfsblvt'];
|
|
||||||
|
|
||||||
// Get event details (works for issues and pull requests)
|
|
||||||
const { owner, repo } = github.context.repo;
|
|
||||||
const payload = github.context.payload;
|
|
||||||
const eventData = payload.issue || payload.pull_request;
|
|
||||||
const username = eventData.user.login;
|
|
||||||
const issue_number = eventData.number;
|
|
||||||
|
|
||||||
if (maintainers.includes(username)) {
|
|
||||||
core.info(`User ${username} is a maintainer. Adding "Maintainer" label to issue/PR #${issue_number}`);
|
|
||||||
await github.rest.issues.addLabels({
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
issue_number,
|
|
||||||
labels: ['👷 Maintainer'],
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
core.info(`User ${username} is not on the maintainer list.`);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user