Replace example code blocks with readable alternatives that support word wrap #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MyCoder Issue Comment Action | |
on: | |
issue_comment: | |
types: [created] | |
# Top-level permissions apply to all jobs - this is the maximum allowed for GITHUB_TOKEN | |
permissions: | |
contents: write # Required for checkout, commit, push | |
issues: write # Required for issue comments | |
pull-requests: write # Required for creating PRs | |
discussions: write # Added for more interaction capabilities | |
statuses: write # Added for creating commit statuses | |
checks: write # Added for creating check runs | |
actions: read # Added for inspecting workflow runs | |
packages: read # Added in case you need to access GitHub packages | |
env: | |
PNPM_VERSION: 10.2.1 | |
jobs: | |
process-comment: | |
runs-on: ubuntu-latest | |
# Only run if comment contains '/mycoder' AND commenter is in AUTHORIZED_USERS list | |
if: | | |
contains(github.event.comment.body, '/mycoder') && | |
github.event.comment.user.login == 'bhouston' | |
steps: | |
- name: Extract prompt from comment | |
id: extract-prompt | |
run: | | |
echo "comment_url=${{ github.event.comment.html_url }}" >> $GITHUB_OUTPUT | |
echo "comment_id=${{ github.event.comment.id }}" >> $GITHUB_OUTPUT | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Configure Git | |
run: | | |
git config --global user.name "MyCoder (On behalf of ${{ github.event.comment.user.login }})" | |
git config --global user.email "[email protected]" | |
- run: | |
pnpm install -g mycoder | |
# Auth GitHub CLI with the token | |
- name: Configure GitHub CLI | |
run: | | |
# First try with GITHUB_TOKEN | |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token | |
# Verify auth status | |
gh auth status | |
- env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
run: | | |
echo "Running MyCoder for issue #${{ github.event.issue.number }} with prompt: ${{ steps.extract-prompt.outputs.prompt }}" | |
mycoder --userWarning false --upgradeCheck false --githubMode true --userPrompt false "On issue #${{ github.event.issue.number }} in comment ${{ steps.extract-prompt.outputs.comment_url }} the user invoked the mycoder CLI via /mycoder. Can you try to do what they requested or if it is unclear, respond with a comment to that affect to encourage them to be more clear." |