Skip to content

Commit 0196189

Browse files
committed
chore: add in issue-triage & pr-review github actions, reorg a bit.
1 parent b3146a3 commit 0196189

File tree

5 files changed

+89
-3
lines changed

5 files changed

+89
-3
lines changed

.github/workflows/deploy-docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Documentation to Cloud Run
1+
name: Deploy Docs
22

33
on:
44
push:

.github/workflows/release.yml .github/workflows/deploy-npm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Deploy NPM
22

33
on:
44
push:

.github/workflows/issue-comment.yml .github/workflows/mycoder-comment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MyCoder Issue Comment Action
1+
name: MyCoder Comment Action
22

33
# This workflow is triggered on all issue comments, but only runs the job
44
# if the comment contains '/mycoder' and is from the authorized user.
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: MyCoder Issue Triage
2+
3+
# This workflow is triggered when new issues are created
4+
on:
5+
issues:
6+
types: [opened]
7+
8+
# Top-level permissions apply to all jobs
9+
permissions:
10+
contents: read # Required for checkout
11+
issues: write # Required for issue comments and labels
12+
pull-requests: read # For context if needed
13+
discussions: read # Added for more context if needed
14+
15+
env:
16+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
17+
18+
jobs:
19+
triage-issue:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version-file: .nvmrc
26+
- uses: pnpm/action-setup@v4
27+
with:
28+
version: ${{ vars.PNPM_VERSION }}
29+
- run: pnpm install
30+
- run: cd packages/agent && pnpm exec playwright install --with-deps chromium
31+
- run: |
32+
git config --global user.name "Ben Houston (via MyCoder)"
33+
git config --global user.email "[email protected]"
34+
- run: pnpm install -g mycoder
35+
- run: |
36+
echo "${{ secrets.GH_PAT }}" | gh auth login --with-token
37+
gh auth status
38+
- run: mycoder --upgradeCheck false --githubMode true --userPrompt false "You are an issue triage assistant. Please analyze GitHub issue ${{ github.event.issue.number }} according to the guidelines in .mycoder/ISSUE_TRIAGE.md. Categorize the issue type (Bug, Feature, Request), suggest appropriate labels, check for duplicates, and provide a helpful initial assessment. If the issue is too vague, ask for more information. For bugs, try to identify potential causes. For feature requests, suggest implementation approaches. For questions, try to provide answers based on the codebase and documentation."
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: MyCoder PR Review
2+
3+
# This workflow is triggered when a PR is opened or updated with new commits
4+
on:
5+
pull_request:
6+
types: [opened, synchronize]
7+
8+
# Top-level permissions apply to all jobs
9+
permissions:
10+
contents: read # Required for checkout
11+
issues: read # Required for reading linked issues
12+
pull-requests: write # Required for commenting on PRs
13+
discussions: read # For reading discussions
14+
statuses: write # For creating commit statuses
15+
checks: write # For creating check runs
16+
actions: read # For inspecting workflow runs
17+
18+
env:
19+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
20+
21+
jobs:
22+
review-pr:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version-file: .nvmrc
29+
- uses: pnpm/action-setup@v4
30+
with:
31+
version: ${{ vars.PNPM_VERSION }}
32+
- run: pnpm install
33+
- run: cd packages/agent && pnpm exec playwright install --with-deps chromium
34+
- run: |
35+
git config --global user.name "Ben Houston (via MyCoder)"
36+
git config --global user.email "[email protected]"
37+
- run: pnpm install -g mycoder
38+
- run: |
39+
echo "${{ secrets.GH_PAT }}" | gh auth login --with-token
40+
gh auth status
41+
- name: Get previous reviews
42+
id: get-reviews
43+
run: |
44+
PR_REVIEWS=$(gh pr view ${{ github.event.pull_request.number }} --json reviews --jq '.reviews')
45+
PR_COMMENTS=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq '.comments')
46+
echo "reviews=$PR_REVIEWS" >> $GITHUB_OUTPUT
47+
echo "comments=$PR_COMMENTS" >> $GITHUB_OUTPUT
48+
- run: mycoder --upgradeCheck false --githubMode true --userPrompt false "Please review PR ${{ github.event.pull_request.number }} according to the guidelines in .mycoder/PR_REVIEW.md. This PR is related to issue ${{ github.event.pull_request.head.ref }} and has the title '${{ github.event.pull_request.title }}'. Review the PR changes, check if it addresses the requirements in the linked issue, and provide constructive feedback. Consider previous review comments and discussions to avoid repetition and help move towards resolution. Previous reviews and comments: ${{ steps.get-reviews.outputs.reviews }} ${{ steps.get-reviews.outputs.comments }}"

0 commit comments

Comments
 (0)