-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up dev deps and added gpt-review and squash-merge-to-prod git…
…hub actions
- Loading branch information
1 parent
4948775
commit 747777b
Showing
3 changed files
with
83 additions
and
8 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,56 @@ | ||
name: gpt_pr_review | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
types: [opened, reopened, synchronize] | ||
pull_request_review_comment: | ||
branches: [ main ] | ||
types: [created] | ||
concurrency: | ||
group: > | ||
${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ | ||
github.workflow }}-${{ github.event_name == 'pull_request_review_comment' && 'pr_comment' || 'pr' }} | ||
cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }} | ||
jobs: | ||
gpt_pr_review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: coderabbitai/ai-pr-reviewer@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
with: | ||
system_message: > | ||
Your purpose is to act as a highly experienced | ||
software engineer and provide a thorough review of the code hunks | ||
and suggest code snippets to improve key areas such as: | ||
- Logic | ||
- Security | ||
- Performance | ||
- Data races | ||
- Consistency | ||
- Error handling | ||
- Maintainability | ||
- Modularity | ||
- Complexity | ||
- Optimization | ||
- Best practices: DRY, SOLID, KISS | ||
Identify and resolve significant concerns to improve overall code | ||
quality while deliberately disregarding minor issues. | ||
summarize: > | ||
Provide your final response in markdown with the following content: | ||
- **Walkthrough**: A high-level summary of the overall change instead of | ||
specific files within 100 words. | ||
- **Changes**: A markdown table of files and their summaries. Group files | ||
with similar changes together into a single row to save space. | ||
Avoid additional commentary as this summary will be added as a comment on the | ||
GitHub pull request. Use the titles "Walkthrough" and "Changes" and they must be H2. | ||
summarize_release_notes: > | ||
Craft concise release notes for the pull request. | ||
Focus on the purpose and user impact, categorizing changes as New Feature, Bug Fix, | ||
Documentation, Refactor, Style, Test, Chore, or Revert. Provide a bullet-point list, | ||
e.g. "- New Feature: Added search functionality to the UI." Limit your response to 50-100 words | ||
and emphasize features visible to the end-user while omitting code-level details. |
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,24 @@ | ||
name: squash_merge_to_prod | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
squash_merge_to_prod: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Configure Git | ||
run: | | ||
git config user.name "Jai Bhagat" | ||
git config user.email "[email protected]" | ||
- name: Merge and squash to prod | ||
run: | | ||
git checkout prod | ||
# Get the latest commit message from the 'main' branch | ||
COMMIT_MSG=$(git log main -1 --pretty=format:%s) | ||
git merge --squash main | ||
git commit -m "$COMMIT_MSG" | ||
git push origin prod |
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