diff --git a/.github/workflows/ai-triage-campaign.lock.yml b/.github/workflows/ai-triage-campaign.lock.yml index 89d5e3bfa8..95e76a42ff 100644 --- a/.github/workflows/ai-triage-campaign.lock.yml +++ b/.github/workflows/ai-triage-campaign.lock.yml @@ -44,8 +44,8 @@ name: "AI Triage Campaign" description: Maximum number of issues to process required: false project_url: - default: https://github.com/users/mnkiefer/projects/24 - description: GitHub project URL (e.g., https://github.com/users/username/projects/24) + default: https://github.com/orgs/githubnext/projects/53 + description: GitHub project URL (e.g., https://github.com/users/username/projects/123 or https://github.com/orgs/orgname/projects/123) required: false permissions: @@ -1036,7 +1036,7 @@ jobs: - name: Setup MCPs env: - GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} run: | mkdir -p /tmp/gh-aw/mcp-config @@ -1235,10 +1235,10 @@ jobs: ## Adding Issues to the Project Board For each issue you analyze, add it to this project board: - `https://github.com/users/mnkiefer/projects/24` + `https://github.com/users/username/projects/123` Use the update-project safe-output with these fields: - - **project**: `https://github.com/users/mnkiefer/projects/24` (always use this exact URL) + - **project**: `https://github.com/users/username/projects/123` (always use this exact URL) - **content_type**: "issue" - **content_number**: the issue number - **fields**: @@ -1249,7 +1249,7 @@ jobs: - Priority: "Critical", "High", "Medium", or "Low" Example for issue #5: - - project: https://github.com/users/mnkiefer/projects/24 + - project: https://github.com/users/username/projects/123 - content_type: issue - content_number: 5 - fields with AI-Readiness Score, Status, Effort Estimate, AI Agent Type, Priority @@ -1322,7 +1322,7 @@ jobs: ## Execution Notes - This workflow runs every 4 hours automatically (or manually with custom parameters) - - Input defaults: max_issues=10, project_url=https://github.com/users/mnkiefer/projects/24 + - Input defaults: max_issues=10, project_url=https://github.com/users/username/projects/123 - All issues are routed to the project board with differentiation via Status field - Custom fields are created automatically if they don't exist - User projects must exist before workflow runs (cannot auto-create) @@ -1577,7 +1577,7 @@ jobs: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GITHUB_HEAD_REF: ${{ github.head_ref }} - GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GITHUB_REF_NAME: ${{ github.ref_name }} GITHUB_STEP_SUMMARY: ${{ env.GITHUB_STEP_SUMMARY }} GITHUB_WORKSPACE: ${{ github.workspace }} @@ -1693,9 +1693,10 @@ jobs: } await main(); env: - GH_AW_SECRET_NAMES: 'COPILOT_CLI_TOKEN,COPILOT_GITHUB_TOKEN,GITHUB_TOKEN' + GH_AW_SECRET_NAMES: 'COPILOT_CLI_TOKEN,COPILOT_GITHUB_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN' SECRET_COPILOT_CLI_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }} SECRET_COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Safe Outputs if: always() @@ -4160,7 +4161,7 @@ jobs: env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} with: - github-token: ${{ secrets.PROJECT_PAT }} + github-token: ${{ secrets.PROJECT_PAT || secrets.GITHUB_TOKEN }} script: | const fs = require("fs"); function loadAgentOutput() { @@ -4197,8 +4198,10 @@ jobs: return { success: true, items: validatedOutput.items }; } function parseProjectInput(projectInput) { - if (!projectInput || typeof projectInput !== 'string') { - throw new Error(`Invalid project input: expected string, got ${typeof projectInput}. The "project" field is required and must be a GitHub project URL, number, or name.`); + if (!projectInput || typeof projectInput !== "string") { + throw new Error( + `Invalid project input: expected string, got ${typeof projectInput}. The "project" field is required and must be a GitHub project URL, number, or name.` + ); } const urlMatch = projectInput.match(/github\.com\/(?:users|orgs)\/[^/]+\/projects\/(\d+)/); if (urlMatch) { @@ -4317,7 +4320,7 @@ jobs: } else { if (ownerType === "User") { const projectDisplay = parsedProjectNumber ? `project #${parsedProjectNumber}` : `project "${parsedProjectName}"`; - core.error(`Cannot find ${projectDisplay}. Create it manually at https://github.com/users/${owner}/projects/new.`); + core.error(`Cannot find ${projectDisplay}. Create it manually at https://github.com/users/${owner}/projects/new.`); throw new Error(`Cannot find ${projectDisplay} on user account.`); } const createResult = await githubClient.graphql( @@ -4382,11 +4385,7 @@ jobs: } let contentNumber = null; if (hasContentNumber || hasIssue || hasPullRequest) { - const rawContentNumber = hasContentNumber - ? output.content_number - : hasIssue - ? output.issue - : output.pull_request; + const rawContentNumber = hasContentNumber ? output.content_number : hasIssue ? output.issue : output.pull_request; const sanitizedContentNumber = rawContentNumber === undefined || rawContentNumber === null ? "" @@ -4476,7 +4475,7 @@ jobs: let itemId; if (existingItem) { itemId = existingItem.id; - core.info('✓ Item already on board'); + core.info("✓ Item already on board"); } else { const addResult = await githubClient.graphql( `mutation($projectId: ID!, $contentId: ID!) { @@ -4534,7 +4533,7 @@ jobs: const normalizedFieldName = fieldName .split(/[\s_-]+/) .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) - .join(' '); + .join(" "); let field = projectFields.find(f => f.name.toLowerCase() === normalizedFieldName.toLowerCase()); if (!field) { const isTextField = @@ -4718,10 +4717,10 @@ jobs: } } } - if (typeof module !== 'undefined' && module.exports) { + if (typeof module !== "undefined" && module.exports) { module.exports = { updateProject, parseProjectInput, generateCampaignId, main }; } - if (typeof module === 'undefined' || require.main === module) { + if (typeof module === "undefined" || require.main === module) { main(); } diff --git a/.github/workflows/ai-triage-campaign.md b/.github/workflows/ai-triage-campaign.md index e30a569d49..e08a609d17 100644 --- a/.github/workflows/ai-triage-campaign.md +++ b/.github/workflows/ai-triage-campaign.md @@ -8,9 +8,9 @@ on: workflow_dispatch: inputs: project_url: - description: 'GitHub project URL (e.g., https://github.com/users/username/projects/24)' + description: 'GitHub project URL (e.g., https://github.com/users/username/projects/123 or https://github.com/orgs/orgname/projects/123)' required: false - default: 'https://github.com/users/mnkiefer/projects/24' + default: 'https://github.com/orgs/githubnext/projects/53' max_issues: description: 'Maximum number of issues to process' required: false @@ -29,12 +29,12 @@ engine: copilot tools: github: mode: local - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} toolsets: [repos, issues] safe-outputs: update-project: max: 20 - github-token: ${{ secrets.PROJECT_PAT }} + github-token: ${{ secrets.PROJECT_PAT || secrets.GITHUB_TOKEN }} missing-tool: --- @@ -176,10 +176,10 @@ For each issue, evaluate: ## Adding Issues to the Project Board For each issue you analyze, add it to this project board: -`https://github.com/users/mnkiefer/projects/24` +`https://github.com/users/username/projects/123` Use the update-project safe-output with these fields: -- **project**: `https://github.com/users/mnkiefer/projects/24` (always use this exact URL) +- **project**: `https://github.com/users/username/projects/123` (always use this exact URL) - **content_type**: "issue" - **content_number**: the issue number - **fields**: @@ -190,7 +190,7 @@ Use the update-project safe-output with these fields: - Priority: "Critical", "High", "Medium", or "Low" Example for issue #5: -- project: https://github.com/users/mnkiefer/projects/24 +- project: https://github.com/users/username/projects/123 - content_type: issue - content_number: 5 - fields with AI-Readiness Score, Status, Effort Estimate, AI Agent Type, Priority @@ -263,7 +263,7 @@ For each issue, provide: ## Execution Notes - This workflow runs every 4 hours automatically (or manually with custom parameters) -- Input defaults: max_issues=10, project_url=https://github.com/users/mnkiefer/projects/24 +- Input defaults: max_issues=10, project_url=https://github.com/users/username/projects/123 - All issues are routed to the project board with differentiation via Status field - Custom fields are created automatically if they don't exist - User projects must exist before workflow runs (cannot auto-create)