-
Notifications
You must be signed in to change notification settings - Fork 0
Auto-PR: Merge maintenance β main #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1bb0cfa
5218437
9bfbe0f
baddebf
63215e3
bb42098
ddee268
033bd0f
bd817f1
380d077
74c9296
8e66b35
98807ea
8976dd4
c13ffd5
cb2ee38
e417d96
c1afa81
d1756d6
d6725ce
fb45c6e
e600c7a
d961f3e
4aa3bc9
88e9fbe
b9d9667
6b5917a
e4741d5
b90f789
6417ac5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| name: Auto-Create PR to Main | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'maintenance' | ||
| - 'feature/*' | ||
| - 'fix/*' | ||
| - 'docs/*' | ||
| - 'hotfix/*' | ||
| - '!main' | ||
| - '!experimental/*' | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| create-pr: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Generate GitHub App Token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 | ||
| with: | ||
| app-id: ${{ secrets.APP_ID }} | ||
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| repositories: ${{ github.event.repository.name }} | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
romandidomizio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Create Pull Request | ||
| id: create-pr | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
| run: | | ||
| # Get current branch name | ||
| BRANCH_NAME="${{ github.ref_name }}" | ||
|
|
||
| # Check if PR already exists | ||
| existing_pr=$(gh pr list --base main --head "$BRANCH_NAME" --json number --jq '.[0].number') | ||
|
|
||
| if [ -n "$existing_pr" ]; then | ||
| echo "PR #$existing_pr already exists, new commits will be added automatically" | ||
| echo "pr_number=$existing_pr" >> $GITHUB_OUTPUT | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Create PR body and title files with cleanup trap | ||
| # Set trap first to ensure cleanup even if second mktemp fails | ||
| trap 'rm -f "$PR_BODY" "$PR_TITLE"' EXIT | ||
| PR_BODY=$(mktemp) | ||
| PR_TITLE=$(mktemp) | ||
romandidomizio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Generate dynamic title from first commit (relative to main when available) | ||
| TARGET_BRANCH="main" | ||
| if git rev-parse --verify "origin/$TARGET_BRANCH" >/dev/null 2>&1; then | ||
| FIRST_COMMIT=$(git log --format=%s -1 "$BRANCH_NAME" ^"origin/$TARGET_BRANCH") | ||
| else | ||
| FIRST_COMMIT=$(git log --format=%s -1 "$BRANCH_NAME") | ||
| fi | ||
|
|
||
| # Fallback if no unique commits are found or subject is empty | ||
romandidomizio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if [ -z "$FIRST_COMMIT" ]; then | ||
| # Determine commit count compared to target branch when possible | ||
| if git rev-parse --verify "origin/$TARGET_BRANCH" >/dev/null 2>&1; then | ||
| COMMIT_COUNT=$(git rev-list --count "$BRANCH_NAME" ^"origin/$TARGET_BRANCH" 2>/dev/null || echo "") | ||
| else | ||
| COMMIT_COUNT=$(git rev-list --count "$BRANCH_NAME" 2>/dev/null || echo "") | ||
| fi | ||
|
|
||
| # Use latest commit message on the branch as an additional hint | ||
| LATEST_SUBJECT=$(git log --format=%s -1 "$BRANCH_NAME" 2>/dev/null || echo "") | ||
|
|
||
| if [ -n "$LATEST_SUBJECT" ]; then | ||
| FIRST_COMMIT="Merge $BRANCH_NAME into $TARGET_BRANCH - $LATEST_SUBJECT" | ||
| elif [ -n "$COMMIT_COUNT" ]; then | ||
| FIRST_COMMIT="Merge $BRANCH_NAME into $TARGET_BRANCH ($COMMIT_COUNT commits)" | ||
| else | ||
| FIRST_COMMIT="Merge $BRANCH_NAME into $TARGET_BRANCH" | ||
| fi | ||
| fi | ||
|
|
||
| # Create title: "Auto-PR: <descriptive subject>" | ||
| echo "Auto-PR: $FIRST_COMMIT" > "$PR_TITLE" | ||
|
|
||
| { | ||
| echo "π€ Automated Pull Request" | ||
| echo "" | ||
| echo "## π Human-in-the-Loop Review Checklist" | ||
| echo "" | ||
| echo "**Review the following before approving this PR:**" | ||
| echo "" | ||
| echo "### Security & Compliance" | ||
| echo "- [ ] All GitHub Copilot AI code review comments addressed" | ||
romandidomizio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "- [ ] SOC2/ISO/IEC 42001 compliance requirements validated" | ||
| echo "- [ ] Security best practices followed (no hardcoded secrets, proper RBAC, etc.)" | ||
| echo "- [ ] No sensitive data in commits" | ||
| echo "- [ ] TLS 1.3 configured where applicable" | ||
| echo "" | ||
| echo "### Code Quality & Testing" | ||
| echo "- [ ] Code follows established conventions and style guides" | ||
| echo "- [ ] All automated tests passing" | ||
| echo "- [ ] No breaking changes (or migration plan documented)" | ||
| echo "- [ ] Performance implications assessed" | ||
| echo "- [ ] Error handling adequate" | ||
| echo "" | ||
| echo "### Documentation & Versioning" | ||
| echo "- [ ] Documentation updated (README, CHANGELOG, inline comments)" | ||
| echo "- [ ] Version numbers incremented appropriately" | ||
| echo "- [ ] API changes documented" | ||
| echo "- [ ] Architecture Decision Records (ADRs) created if applicable" | ||
| echo "" | ||
| echo "### Infrastructure & DevOps" | ||
| echo "- [ ] Helm chart best practices followed" | ||
| echo "- [ ] Kubernetes manifests validated (helm lint, kubectl dry-run)" | ||
| echo "- [ ] Docker best practices followed (multi-stage builds, security)" | ||
| echo "- [ ] Resource limits and requests configured" | ||
| echo "- [ ] Deployment tested in staging" | ||
| echo "" | ||
| echo "## π Recent Commits" | ||
| echo "" | ||
| # Show last 5 commits on current branch (handle missing main branch) | ||
| if git rev-parse --verify origin/main >/dev/null 2>&1; then | ||
| git log --oneline --no-decorate -5 "$BRANCH_NAME" ^origin/main | ||
| else | ||
| git log --oneline --no-decorate -5 "$BRANCH_NAME" | ||
| fi | ||
| echo "" | ||
| echo "---" | ||
| echo "" | ||
| echo "**π Copilot AI Review**: Automated compliance and security validation will run on this PR." | ||
| echo "" | ||
| echo "**π Guidelines**: See \`.github/copilot-instructions.md\` for complete review criteria." | ||
| echo "" | ||
| echo "**Auto-generated by** \`.github/workflows/auto-pr-to-main.yml\`" | ||
|
||
| } > "$PR_BODY" | ||
|
|
||
| # Create PR with dynamic title and body | ||
| pr_url=$(gh pr create \ | ||
| --base main \ | ||
| --head "$BRANCH_NAME" \ | ||
| --title "$(cat "$PR_TITLE")" \ | ||
| --body-file "$PR_BODY") | ||
|
|
||
| # Extract PR number from URL | ||
| pr_number=$(echo "$pr_url" | grep -oE '[0-9]+$') | ||
| echo "pr_number=$pr_number" >> $GITHUB_OUTPUT | ||
| echo "Created PR #$pr_number" | ||
| echo "Note: Copilot auto-review will be triggered by Repository Ruleset" | ||
|
|
||
| # Note: cleanup of PR_BODY and PR_TITLE temp files is handled by the 'trap EXIT' set on line 56 | ||
| # Trap is set before mktemp calls to ensure cleanup even if subsequent operations fail | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,11 +8,12 @@ description: | | |||||
| type: application | ||||||
|
|
||||||
| # Chart version - increment when making changes to chart templates | ||||||
| # Follows Semantic Versioning (https://semver.org/) | ||||||
| version: 2.1.0 | ||||||
| # Follows #WeOwnVer (Season.Week.Day.Version) - see /docs/VERSIONING_WEOWNVER.md | ||||||
| # Current: Season 2, Week 5 (Jan 26-Feb 1, 2026), Day 7 (Sunday, Feb 1) | ||||||
romandidomizio marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| version: 2.5.0 | ||||||
|
|
||||||
| # Application version - AnythingLLM version being deployed | ||||||
| appVersion: "1.9.1" | ||||||
| appVersion: "1.10.0" | ||||||
|
||||||
| appVersion: "1.10.0" | |
| appVersion: "1.9.1" |
Uh oh!
There was an error while loading. Please reload this page.