Add rotation support to cluster item API #15
This file contains hidden or 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
| # Copyright 2026 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Auto-Fix and PR Creator | |
| on: | |
| issues: | |
| types: [labeled] | |
| workflow_dispatch: | |
| inputs: | |
| number: | |
| description: 'Issue number to fix' | |
| required: true | |
| title: | |
| description: 'Issue Title' | |
| required: true | |
| body: | |
| description: 'Issue Body' | |
| required: true | |
| jobs: | |
| auto-fix: | |
| if: >- | |
| github.event.label.name == 'agent: create-pr' || | |
| github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO || secrets.GITHUB_TOKEN }} | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.x' | |
| - name: Run Auto-Fix Script | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| ISSUE_TITLE: ${{ github.event.issue.title || github.event.inputs.title }} | |
| ISSUE_BODY: ${{ github.event.issue.body || github.event.inputs.body }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.number }} | |
| run: | | |
| python .github/scripts/create_pr.py | |
| - name: Verify Compilation | |
| id: compile_check | |
| run: | | |
| # Try compiling to ensure the generated code is correct | |
| ./gradlew compileDebugKotlin --no-daemon || echo "failed" > compile_status.txt | |
| - name: Report Compilation Failure | |
| if: hashFiles('compile_status.txt') != '' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.number }} | |
| run: | | |
| gh issue comment "$ISSUE_NUMBER" --body "⚠️ The **Auto-Fix Agent** attempted to generate a patch for this issue, but the code failed to compile. Maintainers have been notified to inspect the changes manually." | |
| exit 1 | |
| - name: Push Changes and Create Pull Request | |
| env: | |
| GH_TOKEN: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO || secrets.GITHUB_TOKEN }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.number }} | |
| run: | | |
| # Read metadata generated by Python script | |
| BRANCH_NAME=$(jq -r '.branch_name' pr_metadata.json) | |
| COMMIT_MESSAGE=$(jq -r '.commit_message' pr_metadata.json) | |
| PR_TITLE=$(jq -r '.pr_title' pr_metadata.json) | |
| PR_BODY=$(jq -r '.pr_body' pr_metadata.json) | |
| # Git configuration | |
| git config --global user.name "googlemaps-bot" | |
| git config --global user.email "googlemaps-bot@google.com" | |
| # Create branch and commit | |
| git checkout -b "$BRANCH_NAME" | |
| git add . | |
| git commit -m "$COMMIT_MESSAGE" | |
| # Push branch | |
| git push origin "$BRANCH_NAME" --force | |
| # Create Pull Request | |
| gh pr create \ | |
| --title "$PR_TITLE" \ | |
| --body "$PR_BODY" \ | |
| --head "$BRANCH_NAME" \ | |
| --base main | |
| # Add a comment to the issue | |
| gh issue comment "$ISSUE_NUMBER" --body "🚀 The **Auto-Fix Agent** has successfully generated a patch and created a Pull Request to address this issue! Please review the proposed changes." | |
| # Remove 'agent: create-pr' label | |
| gh issue edit "$ISSUE_NUMBER" --remove-label "agent: create-pr" || true |