RD-1149: Add projection switching #9
Workflow file for this run
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
| name: Automated PR v3 | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| issue_key: | ||
| description: 'Issue key' | ||
| required: true | ||
| issue_summary: | ||
| description: 'Brief summary of the issue' | ||
| required: true | ||
| issue_description: | ||
| description: 'Detailed issue description' | ||
| required: true | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| jobs: | ||
| automate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Set up developer tools | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
| - name: Set up JDK | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '21' | ||
| - name: Set up Gradle | ||
| uses: gradle/actions/setup-gradle@v3 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| # Symlink agents file to the root | ||
| - name: Symlink agents | ||
| run: ln -s .github/copilot-instructions.md AGENTS.md | ||
| - name: Load agent directives | ||
| id: agent_directives | ||
| run: | | ||
| echo "directives<<EOF" >> "$GITHUB_OUTPUT" | ||
| cat .github/copilot-instructions.md >> "$GITHUB_OUTPUT" | ||
| echo "EOF" >> "$GITHUB_OUTPUT" | ||
| # Generate JS docs | ||
| - name: Set up Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| - name: Install JS deps | ||
| working-directory: js | ||
| run: npm ci | ||
| - name: Build JS docs | ||
| working-directory: js | ||
| run: npm run doc | ||
| # Set up environment variables | ||
| - name: Prepare variables | ||
| run: | | ||
| echo "ISSUE_KEY=${{ github.event.inputs.issue_key }}" >> $GITHUB_ENV | ||
| echo "TITLE=${{ github.event.inputs.issue_summary }}" >> $GITHUB_ENV | ||
| DESC_CLEANED=$(echo "${{ github.event.inputs.issue_description }}" | tr '\n' ' ' | sed 's/"/'\''/g') | ||
| echo "DESC=$DESC_CLEANED" >> $GITHUB_ENV | ||
| echo "BRANCH=${{ github.event.inputs.issue_key }}" >> $GITHUB_ENV | ||
| # Run the LLM Agent and commit the output | ||
| - name: 'Run Gemini CLI' | ||
| id: 'run_gemini' | ||
| uses: 'google-github-actions/run-gemini-cli@v0' # ratchet:exclude | ||
| env: | ||
| GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN || github.token }}' | ||
| IS_PULL_REQUEST: '${{ !!github.event.pull_request }}' | ||
| REPOSITORY: '${{ github.repository }}' | ||
| AGENT_DIRECTIVES: '${{ steps.agent_directives.outputs.directives }}' | ||
| with: | ||
| gemini_api_key: '${{ secrets.GEMINI_API_KEY }}' | ||
| gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}' | ||
| gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}' | ||
| gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}' | ||
| gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}' | ||
| use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}' | ||
| google_api_key: '${{ secrets.GOOGLE_API_KEY }}' | ||
| use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}' | ||
| gemini_debug: '${{ fromJSON(vars.DEBUG || vars.ACTIONS_STEP_DEBUG || false) }}' | ||
| gemini_model: '${{ vars.GEMINI_MODEL }}' | ||
| settings: |- | ||
| { | ||
| "maxSessionTurns": 50, | ||
| "telemetry": { | ||
| "enabled": ${{ vars.GOOGLE_CLOUD_PROJECT != '' }}, | ||
| "target": "gcp" | ||
| }, | ||
| "mcpServers": { | ||
| "github": { | ||
| "command": "docker", | ||
| "args": [ | ||
| "run", | ||
| "-i", | ||
| "--rm", | ||
| "-e", | ||
| "GITHUB_PERSONAL_ACCESS_TOKEN", | ||
| "ghcr.io/github/github-mcp-server" | ||
| ], | ||
| "includeTools": [ | ||
| "add_issue_comment", | ||
| "get_issue", | ||
| "get_issue_comments", | ||
| "list_issues", | ||
| "search_issues", | ||
| "create_pull_request", | ||
| "get_pull_request", | ||
| "get_pull_request_comments", | ||
| "get_pull_request_diff", | ||
| "get_pull_request_files", | ||
| "list_pull_requests", | ||
| "search_pull_requests", | ||
| "create_branch", | ||
| "create_or_update_file", | ||
| "delete_file", | ||
| "fork_repository", | ||
| "get_commit", | ||
| "get_file_contents", | ||
| "list_commits", | ||
| "push_files", | ||
| "search_code" | ||
| ], | ||
| "env": { | ||
| "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" | ||
| } | ||
| } | ||
| }, | ||
| "coreTools": [ | ||
| "read_file", | ||
| "write_file", | ||
| "replace", | ||
| "list_directory", | ||
| "glob", | ||
| "search_file_content", | ||
| "run_shell_command(cat)", | ||
| "run_shell_command(echo)", | ||
| "run_shell_command(grep)", | ||
| "run_shell_command(head)", | ||
| "run_shell_command(tail)" | ||
| ] } | ||
| prompt: |- | ||
| Implement ticket ${{ env.ISSUE_KEY }}: ${{ env.TITLE }}. ${{ env.DESC }} | ||
| - name: Agent commit | ||
| run: | | ||
| git add -A | ||
| git commit -m "$ISSUE_KEY: $TITLE" | ||
| # Prepare and push Pull Request | ||
| - id: cpr | ||
| name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| base: main | ||
| branch: ${{ env.BRANCH }} | ||
| title: "${{ env.ISSUE_KEY }}: ${{ env.TITLE }}" | ||
| body: | | ||
| **${{ env.ISSUE_KEY }}** | ||
| ## Objective | ||
| **${{ env.TITLE }}**. | ||
| ## Description | ||
| ${{ env.DESC }} | ||
| ## Acceptance | ||
| Compiles and checks pass. | ||