diff --git a/.github/actions/bot/index.js b/.github/actions/bot/index.js index 44518f421..cbb6b8fc4 100644 --- a/.github/actions/bot/index.js +++ b/.github/actions/bot/index.js @@ -117,6 +117,8 @@ function buildCommand(uuid, payload, name, args) { return new EchoCommand(uuid, payload, args); case "ci": return new CICommand(uuid, payload, args); + case "summarize" + return new SummarizeCommand(uuid, payload, args); default: console.log(`Unknown command: ${name}`); return null; @@ -147,6 +149,20 @@ class EchoCommand { } } +class SummarizeCommand { + constructor(uuid, payload, args){ + console.log("Constructor"); + console.log(JSON.stringify(uuid)); + console.log(JSON.stringify(payload)); + console.log(JSON.stringify(args)); + } + + async run(author, github) { + console.log("Run!"); + console.log(JSON.stringify(author)); + console.log(JSON.stringify(github)); + } +} class CICommand { workflow_goal_prefix = "workflow:"; constructor(uuid, payload, args) { diff --git a/.github/workflows/bot-trigger.yaml b/.github/workflows/bot-trigger.yaml index 1fca0abd7..32bcee8ea 100644 --- a/.github/workflows/bot-trigger.yaml +++ b/.github/workflows/bot-trigger.yaml @@ -6,7 +6,7 @@ on: - created jobs: bot: - if: ${{ github.event.issue.pull_request }} + #if: ${{ github.event.issue.pull_request }} runs-on: ubuntu-latest permissions: write-all steps: diff --git a/.github/workflows/summarize.yml b/.github/workflows/summarize.yml index 624f65468..bc1ad23f8 100644 --- a/.github/workflows/summarize.yml +++ b/.github/workflows/summarize.yml @@ -9,36 +9,36 @@ permissions: env: AWS_REGION : "us-west-2" jobs: - summarize: - if: contains(github.event.comment.body, '/summarize') - runs-on: ubuntu-latest - steps: - # Checkout the repo - - name: Checkout repository - uses: actions/checkout@v2 - # Get Nodejs lib - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - # Install github actions lib - - name: Install github actions lib - run: npm install @actions/github@5.0.0 - - name: Install core actions lib - run: npm install @actions/core - - name: Install aws bedrock lib - run: npm install @aws-sdk/client-bedrock-runtime - # Get AWS Credentials - - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.BEDROCK_ACTION_ROLE_ARN }} - aws-region: ${{ env.AWS_REGION }} - role-session-name: GITHUB_ACTION - # invoke Bedrock to summarize the issue - - name: Summarize issues - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MODEL_ID : "anthropic.claude-3-5-sonnet-20240620-v1:0" - COMMENT_BODY: ${{ github.event.comment.body }} - run: node .github/actions/summarizer/index.js + #summarize: + # if: contains(github.event.comment.body, '/summarize') + # runs-on: ubuntu-latest + # steps: + # # Checkout the repo + # - name: Checkout repository + # uses: actions/checkout@v2 + # # Get Nodejs lib + # - name: Set up Node.js + # uses: actions/setup-node@v2 + # with: + # node-version: '14' + # # Install github actions lib + # - name: Install github actions lib + # run: npm install @actions/github@5.0.0 + # - name: Install core actions lib + # run: npm install @actions/core + # - name: Install aws bedrock lib + # run: npm install @aws-sdk/client-bedrock-runtime + # # Get AWS Credentials + # - name: configure aws credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: ${{ secrets.BEDROCK_ACTION_ROLE_ARN }} + # aws-region: ${{ env.AWS_REGION }} + # role-session-name: GITHUB_ACTION + # # invoke Bedrock to summarize the issue + # - name: Summarize issues + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # MODEL_ID : "anthropic.claude-3-5-sonnet-20240620-v1:0" + # COMMENT_BODY: ${{ github.event.comment.body }} + # run: node .github/actions/summarizer/index.js