mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 09:44:21 +01:00
ci: auto label web
This commit is contained in:
26
.github/workflows/auto-label-tui.yml
vendored
26
.github/workflows/auto-label-tui.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- name: Add opentui label
|
- name: Auto-label and assign issues
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -20,10 +20,32 @@ jobs:
|
|||||||
const title = issue.title;
|
const title = issue.title;
|
||||||
const description = issue.body || '';
|
const description = issue.body || '';
|
||||||
|
|
||||||
|
// Check for web/desktop keywords
|
||||||
|
const webPattern = /\b(web|desktop)\b/i;
|
||||||
|
const isWebRelated = webPattern.test(title) || webPattern.test(description);
|
||||||
|
|
||||||
// Check for version patterns like v1.0.x or 1.0.x
|
// Check for version patterns like v1.0.x or 1.0.x
|
||||||
const versionPattern = /[v]?1\.0\./i;
|
const versionPattern = /[v]?1\.0\./i;
|
||||||
|
const isVersionRelated = versionPattern.test(title) || versionPattern.test(description);
|
||||||
|
|
||||||
if (versionPattern.test(title) || versionPattern.test(description)) {
|
if (isWebRelated) {
|
||||||
|
// Add web label
|
||||||
|
await github.rest.issues.addLabels({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
labels: ['web']
|
||||||
|
});
|
||||||
|
|
||||||
|
// Assign to adamdotdevin
|
||||||
|
await github.rest.issues.addAssignees({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
assignees: ['adamdotdevin']
|
||||||
|
});
|
||||||
|
} else if (isVersionRelated) {
|
||||||
|
// Only add opentui if NOT web-related
|
||||||
await github.rest.issues.addLabels({
|
await github.rest.issues.addLabels({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
|
|||||||
Reference in New Issue
Block a user