Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/agents/issuelens.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,34 @@ The comment should include, in order:
</details>
```

Post the comment on the issue using `github/add_issue_comment`.
Post the comment on the issue by writing and executing the following Python script inline. The script reads `GITHUB_TOKEN` (or `GITHUB_ACCESS_TOKEN`) from the environment.

```python
import os, sys, requests

def add_issue_comment(owner, repo, issue_number, body):
token = (
os.environ.get("GITHUB_TOKEN")
or os.environ.get("GITHUB_ACCESS_TOKEN")
or os.environ.get("GITHUB_PAT")
)
if not token:
print("❌ GitHub token not found. Set GITHUB_TOKEN, GITHUB_ACCESS_TOKEN, or GITHUB_PAT.", file=sys.stderr)
sys.exit(1)
url = f"https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}/comments"
headers = {
"Authorization": f"Bearer {token}",
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
}
response = requests.post(url, headers=headers, json={"body": body})
response.raise_for_status()
result = response.json()
print(f"✅ Comment posted on issue #{issue_number}: {result['html_url']}")

# Fill in owner, repo, issue_number, and body before running:
add_issue_comment("<owner>", "<repo>", <issue_number>, "<comment_body>")
```

## Step 2: Label the Issue

Expand Down
6 changes: 3 additions & 3 deletions .github/skills/label-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Fetch `.github/llms.md` from the target repository using GitHub MCP tools. The f

For template format, see [references/label_instructions_template.md](references/label_instructions_template.md).

If `.github/label-instructions.md` is not found:
If `.github/llms.md` is not found:
1. Fetch the list of labels defined in the target repository using `github/list_labels`
2. Create a brief summary of available labels based on their names and descriptions
3. Use the summary to determine which labels best match the issue content
Expand Down Expand Up @@ -103,8 +103,8 @@ Report the labeling decision with:

The skill requires:

1. **GITHUB_ACCESS_TOKEN** or **GITHUB_PAT** environment variable with `repo` scope
2. **label-instructions.md** in target repository (optional but recommended)
1. **GITHUB_ACCESS_TOKEN** or **GITHUB_TOKEN** environment variable with `repo` scope
2. **.github/llms.md** in target repository (optional but recommended)

## Fallback Behavior

Expand Down
4 changes: 2 additions & 2 deletions .github/skills/label-issue/scripts/label_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

def get_github_token() -> str:
"""Get GitHub token from environment variables."""
token = os.environ.get("GITHUB_ACCESS_TOKEN") or os.environ.get("GITHUB_PAT")
token = os.environ.get("GITHUB_ACCESS_TOKEN") or os.environ.get("GITHUB_TOKEN") or os.environ.get("GITHUB_PAT")
if not token:
raise ValueError(
"GitHub token not found. Set GITHUB_ACCESS_TOKEN or GITHUB_PAT environment variable."
"GitHub token not found. Set GITHUB_ACCESS_TOKEN, GITHUB_TOKEN, or GITHUB_PAT environment variable."
)
return token

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/issueLens-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
required: true
type: string

permissions:
issues: write
contents: read

jobs:
run-issuelens:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,6 +58,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVATOOLING_INDEX_URL: ${{ secrets.JAVATOOLING_INDEX_URL }}
MAILING_URL: ${{ secrets.MAILING_URL }}
REPORT_RECIPIENTS: ${{ secrets.REPORT_RECIPIENTS }}

- name: Upload triage output
uses: actions/upload-artifact@v4
Expand Down
Loading