From b6472911f3fda9877367e78d5055317bcc18b737 Mon Sep 17 00:00:00 2001 From: Jimmy Royer Date: Mon, 9 Sep 2024 16:35:12 -0400 Subject: [PATCH] Add cds-ai-codereviewer github action to k8s repo (#2922) * Typos * Added CDS AI code review github action --- .github/actions/diff-env-vars/action.yaml | 4 ++-- .github/workflows/ai-code-scanner.yml | 26 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ai-code-scanner.yml diff --git a/.github/actions/diff-env-vars/action.yaml b/.github/actions/diff-env-vars/action.yaml index 9535554dd..2cf1e67ee 100644 --- a/.github/actions/diff-env-vars/action.yaml +++ b/.github/actions/diff-env-vars/action.yaml @@ -5,13 +5,13 @@ inputs: description: The name of the first environment required: true env1-vars: - description: The first environment's varaible names + description: The first environment's variable names required: true env2-name: description: The name of the second environment required: true env2-vars: - description: The second envrionment's variable names + description: The second environment's variable names required: true runs: diff --git a/.github/workflows/ai-code-scanner.yml b/.github/workflows/ai-code-scanner.yml new file mode 100644 index 000000000..65265cbb9 --- /dev/null +++ b/.github/workflows/ai-code-scanner.yml @@ -0,0 +1,26 @@ +name: AI Code Review + +on: + pull_request: + types: + - opened + - synchronize + +jobs: + ai_code_review: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: AI Code Review + uses: cds-snc/cds-ai-codereviewer@main + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_API_MODEL: ${{ vars.OPENAI_API_MODEL }} + OPENAI_API_VERSION: ${{ vars.OPENAI_API_VERSION }} + OPENAI_BASE_URL: ${{ vars.OPENAI_BASE_URL }} + exclude: "**/.env,**/*.aws,**/*.zip,*lock*" + include: "**/*.js,**/*.md,**/*.ps1,**/*.sh,**/*.txt,**/*.yml"