Fleet Merge #122
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
| # Generated by @google/jules-fleet init | |
| # https://github.com/google-labs-code/jules-sdk | |
| name: Fleet Merge | |
| on: | |
| schedule: | |
| - cron: '0 */3 * * *' | |
| workflow_run: | |
| workflows: ['Conflict Detection'] | |
| types: [completed] | |
| workflow_dispatch: | |
| inputs: | |
| mode: | |
| description: 'PR selection mode' | |
| type: choice | |
| options: | |
| - label | |
| - fleet-run | |
| default: 'label' | |
| fleet_run_id: | |
| description: 'Fleet run ID (required for fleet-run mode)' | |
| type: string | |
| default: '' | |
| redispatch: | |
| description: 'Enable smart conflict resolution' | |
| type: boolean | |
| default: true | |
| concurrency: | |
| group: fleet-merge | |
| cancel-in-progress: false | |
| jobs: | |
| merge: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Decode private key | |
| id: decode-key | |
| run: | | |
| echo "${{ secrets.FLEET_APP_PRIVATE_KEY_BASE64 }}" | base64 -d > /tmp/fleet-app-key.pem | |
| { | |
| echo "pem<<PEMEOF" | |
| cat /tmp/fleet-app-key.pem | |
| echo "PEMEOF" | |
| } >> "$GITHUB_OUTPUT" | |
| rm /tmp/fleet-app-key.pem | |
| - name: Generate Fleet App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.FLEET_APP_ID }} | |
| private-key: ${{ steps.decode-key.outputs.pem }} | |
| - run: | | |
| REDISPATCH_FLAG="--redispatch" | |
| if [ "${{ inputs.redispatch }}" = "false" ]; then | |
| REDISPATCH_FLAG="" | |
| fi | |
| npm install --prefix /tmp/fleet @google/jules-fleet | |
| /tmp/fleet/node_modules/.bin/jules-fleet merge --mode ${{ inputs.mode || 'label' }} --run-id "${{ inputs.fleet_run_id }}" $REDISPATCH_FLAG | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| JULES_API_KEY: ${{ secrets.JULES_API_KEY }} | |
| GITHUB_APP_ID: ${{ secrets.FLEET_APP_ID }} | |
| GITHUB_APP_PRIVATE_KEY_BASE64: ${{ secrets.FLEET_APP_PRIVATE_KEY_BASE64 }} | |
| GITHUB_APP_INSTALLATION_ID: ${{ secrets.FLEET_APP_INSTALLATION_ID }} |