-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #360 from aws-samples/yike5460-dev
feat: add intelli-ops github workflow
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Intelligent Code Review | ||
# Enable manual trigger | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
# Avoid running the same workflow on the same branch concurrently | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
review: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# read repository contents and write pull request comments | ||
id-token: write | ||
# allow github action bot to push new content into existing pull requests | ||
contents: write | ||
# contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies @actions/core and @actions/github | ||
run: | | ||
npm install @actions/core | ||
npm install @actions/github | ||
shell: bash | ||
|
||
# check if required dependencies @actions/core and @actions/github are installed | ||
- name: Check if required dependencies are installed | ||
run: | | ||
npm list @actions/core | ||
npm list @actions/github | ||
shell: bash | ||
|
||
- name: Debug GitHub Token | ||
run: | | ||
if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then | ||
echo "GitHub Token is set" | ||
else | ||
echo "GitHub Token is not set" | ||
fi | ||
# assume the specified IAM role and set up the AWS credentials for use in subsequent steps. | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::705247044519:role/GitHub-Workflow-OIDC-Role-bHb9ZhppJUj8 | ||
aws-region: us-east-1 | ||
|
||
- name: Intelligent GitHub Actions | ||
uses: yike5460/intelli-ops@stable | ||
with: | ||
# Automatic Provision: The GITHUB_TOKEN is automatically created and provided by GitHub for each workflow run. You don't need to manually create or store this token as a secret. | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
aws-region: us-east-1 | ||
model-id: anthropic.claude-3-sonnet-20240229-v1:0 | ||
exclude-files: '*.md,*.json,*.yml,*.yaml' | ||
review-level: 'concise' | ||
code-review: 'true' | ||
generate-pr-description: 'true' | ||
generate-unit-test-suite: 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |