Skip to content

Commit 2edf1a2

Browse files
committed
adds gha to use trigger copilot reviews
1 parent d9c7669 commit 2edf1a2

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

.github/review-instructions.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copilot Code Review Instructions
2+
3+
When reviewing code in this repository, please keep the following in mind:
4+
5+
## Terraform Provider Specific
6+
- Ensure all schema attributes have proper `Description` fields
7+
- Check that `d.Set()` calls handle errors appropriately
8+
- Verify that API responses are properly closed with `defer resp.Body.Close()`
9+
- Ensure `TypeSet` vs `TypeList` is used correctly based on ordering requirements
10+
- Check for proper nil checks before type assertions
11+
12+
## Go Best Practices
13+
- Ensure error messages are descriptive and include context
14+
- Check for proper resource cleanup in deferred functions
15+
- Verify that context is properly propagated through function calls
16+
17+
## Testing
18+
- Ensure acceptance tests use proper resource naming
19+
- Check that test fixtures match the test expectations
20+
- Verify VCR cassettes are updated when API calls change
21+
22+
## Security
23+
- No sensitive values should be logged
24+
- Ensure sensitive schema fields are marked with `Sensitive: true`
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: GH Co-pilot Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
copilot-review:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Request Copilot Review
17+
uses: actions/github-script@v7
18+
with:
19+
script: |
20+
await github.rest.pulls.requestReviewers({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
pull_number: context.payload.pull_request.number,
24+
reviewers: ['copilot'] // Request Copilot as reviewer
25+
});

0 commit comments

Comments
 (0)