Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Auto Create PR

on:
push:
branches:
- 'feat/**'
- 'fix/**'
- 'bug/**'
- 'docs/**'
- 'style/**'
- 'refactor/**'
- 'perf/**'
- 'test/**'
- 'build/**'
- 'ci/**'
- 'chore/**'
- 'revert/**'

permissions:
pull-requests: write
contents: read

jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check and create PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH_NAME="${GITHUB_REF#refs/heads/}"

# Check if an open PR already exists from this branch to main
PR_COUNT=$(gh pr list --head "$BRANCH_NAME" --base main --state open --json id --jq 'length')

if [ "$PR_COUNT" -eq 0 ]; then
echo "No open PR found for branch '$BRANCH_NAME'. Creating one..."

# Format the title (e.g., 'feat/my-feature' -> 'feat: my feature')
TITLE=$(echo "$BRANCH_NAME" | sed -E 's|^([^/]+)/(.*)|\1: \2|' | tr '-' ' ')

gh pr create \
--head "$BRANCH_NAME" \
--base main \
--title "$TITLE" \
--body "Automated PR created from branch \`$BRANCH_NAME\`."

echo "PR created successfully."
else
echo "An open PR already exists for branch '$BRANCH_NAME'. Skipping PR creation."
fi
21 changes: 21 additions & 0 deletions .github/workflows/jules-pr-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Jules PR Review
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: jules-review-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
statuses: write
steps:
- uses: sanjay3290/jules-pr-reviewer@v1
with:
jules_api_key: ${{ secrets.JULES_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Loading