Skip to content

Commit 44134f1

Browse files
pranaydeokar-cdclouddrove-cianmolnagpal
authored
Feat/claude pr check (#234)
Co-authored-by: CloudDrove CI <[email protected]> Co-authored-by: Anmol Nagpal <[email protected]>
1 parent 17c2f9e commit 44134f1

24 files changed

+127
-30
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Claude PR Review Checks
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
branch:
8+
description: 'Specify the branch if needed'
9+
required: false
10+
type: string
11+
secrets:
12+
ANTHROPIC_API_KEY:
13+
description: 'Anthropic API Key'
14+
required: true
15+
16+
permissions:
17+
id-token: write
18+
contents: read
19+
actions: read
20+
21+
jobs:
22+
# Regular PR Checks
23+
pr-checks:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repo
27+
uses: actions/checkout@v4
28+
29+
# Claude AI feedback
30+
claude:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 1
37+
- name: Automatic PR Review
38+
uses: anthropics/claude-code-action@beta
39+
with:
40+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
41+
github_token: ${{ secrets.CLAUDE_PAT }}
42+
timeout_minutes: "60"
43+
direct_prompt: |
44+
Please review this pull request and provide comprehensive feedback.
45+
46+
Focus on:
47+
- Code quality and best practices
48+
- Potential bugs or issues
49+
- Performance considerations
50+
- Security implications
51+
- Test coverage
52+
- Documentation updates if needed
53+
54+
Provide constructive feedback with specific suggestions for improvement.
55+
Use inline comments to highlight specific areas of concern.
56+
57+
...

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -91,39 +91,39 @@ Above example is just a simple example to call workflow from github shared workf
9191
1. [Auto Assign Assignee Workflow](./docs/01.auto-assignee.md)
9292
2. [AWS SSM Send Command workflow](./docs/02.AWSSSMSendCommand.md)
9393
3. [Checkov Workflow](./docs/03.checkov.md)
94-
4. [Deploy CloudFormation Stack workflow](./docs/04.deploy-cloudformation.md)
95-
5. [Deploy CloudFormation StackSet workflow](./docs/05.deploy-cloudformation-stackset.md)
96-
6. [Docker Workflow](./docs/06.docker.md)
97-
* [Example for scan and push docker image on Dockerhub](./docs/06.docker.md#example-for-scan-and-push-docker-image-on-dockerhub)
98-
* [Example for scan and push docker image on ECR](./docs/06.docker.md#example-for-scan-and-push-docker-image-on-ecr)
94+
4. [Cloude PR Review Workflow](./docs/04.claude-pr-review.md)
95+
5. [Deploy CloudFormation Stack workflow](./docs/05.deploy-cloudformation.md)
96+
6. [Deploy CloudFormation StackSet workflow](./docs/06.deploy-cloudformation-stackset.md)
9997
7. [Docker Scout workflow](./docs/07.docker-scout.md)
100-
8. [Helm Workflow](./docs/08.helm.md)
101-
* [Example for AWS cloud provider](./docs/08.helm.md#example-for-aws-cloud-provider)
102-
* [Example for Azure cloud provider](./docs/08.helm.md)
103-
9. [Infracost workflow](./docs/09.infracost.md)
104-
10. [Lock Thread workflow](./docs/10.lock.md)
105-
11. [Powerpipe workflow](./docs/11.powerpipe.md)
106-
12. [PR Checks workflow](./docs/12.pr-checks.md)
107-
13. [Prowler workflow](./docs/13.prowler.md)
108-
14. [Prowler workflow (AWS)](./docs/14.prowlerAWS.md)
109-
15. [Prowler workflow (GCP)](./docs/15.prowlerGCP.md)
110-
16. [README Generation workflow](./docs/16.readme.md)
111-
17. [Remote SSH Command workflow](./docs/17.RemoteSSHCommand.md)
112-
18. [Slack Alert](./docs/18.slack.md)
113-
19. [Smurf Docker + Helm Workflow](./docs/19.smurf-docker-helm.md)
114-
20. [Smurf Terraform Workflow](./docs/20.smurf-terraform.md)
115-
21. [SST Workflow](./docs/21.sst.md)
116-
22. [Stale PR workflow](./docs/22.stale-pr.md)
117-
23. [Tag Release workflow](./docs/23.tag-release.md)
118-
24. [Terraform Checks Workflow](./docs/24.tf-checks.md)
119-
* [Example for terraform checks with azure cloud](./docs/24.tf-checks.md#example-for-terraform-checks-with-azure-cloud)
120-
* [Example for terraform checks with aws cloud](./docs/24.tf-checks.md#example-for-terraform-checks-with-aws-cloud)
121-
* [Example for terraform checks with digitalocean cloud](./docs/24.tf-checks.md#example-for-terraform-checks-with-digitalocean-cloud)
98+
8. [Docker Workflow](./docs/08.docker.md)
99+
* [Example for scan and push docker image on Dockerhub](./docs/08.docker.md#example-for-scan-and-push-docker-image-on-dockerhub)
100+
* [Example for scan and push docker image on ECR](./docs/08.docker.md#example-for-scan-and-push-docker-image-on-ecr)
101+
9. [Helm Workflow](./docs/09.helm.md)
102+
* [Example for AWS cloud provider](./docs/09.helm.md#example-for-aws-cloud-provider)
103+
* [Example for Azure cloud provider](./docs/09.helm.md)
104+
10. [Infracost workflow](./docs/10.infracost.md)
105+
11. [Lock Thread workflow](./docs/11.lock.md)
106+
12. [Powerpipe workflow](./docs/12.powerpipe.md)
107+
13. [PR Checks workflow](./docs/13.pr-checks.md)
108+
14. [Prowler workflow](./docs/14.prowler.md)
109+
15. [Prowler workflow (AWS)](./docs/15.prowlerAWS.md)
110+
16. [Prowler workflow (GCP)](./docs/16.prowlerGCP.md)
111+
17. [README Generation workflow](./docs/17.readme.md)
112+
18. [Remote SSH Command workflow](./docs/18.RemoteSSHCommand.md)
113+
19. [Slack Alert](./docs/19.slack.md)
114+
20. [Smurf Docker + Helm Workflow](./docs/20.smurf-docker-helm.md)
115+
21. [Smurf Terraform Workflow](./docs/21.smurf-terraform.md)
116+
22. [SST Workflow](./docs/22.sst.md)
117+
23. [Stale PR workflow](./docs/23.stale-pr.md)
118+
24. [Tag Release workflow](./docs/24.tag-release.md)
122119
25. [Terraform Checks Workflow](./docs/25.tf-checks.md)
120+
* [Example for terraform checks with azure cloud](./docs/25.tf-checks.md#example-for-terraform-checks-with-azure-cloud)
121+
* [Example for terraform checks with aws cloud](./docs/25.tf-checks.md#example-for-terraform-checks-with-aws-cloud)
122+
* [Example for terraform checks with digitalocean cloud](./docs/25.tf-checks.md#example-for-terraform-checks-with-digitalocean-cloud)
123123
26. [Terraform Lint Workflow](./docs/26.terraform-lint.md)
124-
27. [Terraform Module Tag Release Workflow (Shared)](./docs/26.tf-monorepo-tag-release.md)
125-
28. [Terraform PR Plan Diff workflow](./docs/28.tf-pr-checks.md)
126-
29. [Terraform Workflow](./docs/29.terraform_workflow.md)
124+
27. [Terraform Workflow](./docs/27.terraform_workflow.md)
125+
28. [Terraform Module Tag Release Workflow (Shared)](./docs/28.tf-monorepo-tag-release.md)
126+
29. [Terraform PR Plan Diff workflow](./docs/29.tf-pr-checks.md)
127127
128128
## Feedback
129129
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/github-shared-workflows/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).

docs/04.claude-pr-review.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Claude Code PR Checks Workflow
2+
3+
4+
This reusable workflow integrates Anthropic Claude to automatically review Pull Requests and provide feedback using inline comments and a summary review.
5+
6+
The Claude Code Review action is triggered when the workflow is called from another workflow using workflow_call.
7+
8+
#### Usage
9+
10+
This workflow provides:
11+
12+
- Regular PR checks (e.g., repo checkout)
13+
14+
- Claude Code review with configurable prompt
15+
16+
- Inline and summary feedback on PRs
17+
18+
#### Example Caller Workflow
19+
20+
```yaml
21+
22+
name: PR Checks Caller
23+
24+
on:
25+
pull_request:
26+
branches: ["master"] # Limits this workflow to trigger only when PRs are opened against the 'master' branch
27+
types: [opened, reopened, synchronize]
28+
29+
permissions:
30+
id-token: write
31+
contents: read
32+
actions: read
33+
34+
jobs:
35+
claude-feedback:
36+
uses: clouddrove/github-shared-workflows/.github/workflows/claude-pr-review.yml@master
37+
secrets:
38+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} # Secret API key used to authenticate with Claude (Anthropic)
39+
```
40+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)