Fleet Dispatch #105
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 Dispatch | |
| on: | |
| schedule: | |
| - cron: '0 3-23/6 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| milestone: | |
| description: 'Milestone ID to dispatch (leave empty to dispatch all)' | |
| type: string | |
| required: false | |
| concurrency: | |
| group: fleet-dispatch | |
| cancel-in-progress: false | |
| jobs: | |
| discover: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| milestones: ${{ steps.list.outputs.milestones }} | |
| steps: | |
| - name: Resolve milestones | |
| id: list | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| INPUT_MILESTONE: ${{ inputs.milestone }} | |
| run: | | |
| if [ -n "$INPUT_MILESTONE" ]; then | |
| echo "milestones=[\"$INPUT_MILESTONE\"]" >> "$GITHUB_OUTPUT" | |
| else | |
| milestones=$(gh api repos/${{ github.repository }}/milestones --jq '[.[].number | tostring]') | |
| echo "milestones=$milestones" >> "$GITHUB_OUTPUT" | |
| fi | |
| dispatch: | |
| needs: discover | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| milestone: ${{ fromJSON(needs.discover.outputs.milestones) }} | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Decode private key | |
| id: decode-key | |
| run: | | |
| printf '%s' "${{ secrets.FLEET_APP_PRIVATE_KEY }}" | 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: npx -y --package=@google/jules-fleet jules-fleet dispatch --milestone ${{ matrix.milestone }} | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| JULES_API_KEY: ${{ secrets.JULES_API_KEY }} | |
| FLEET_APP_ID: ${{ secrets.FLEET_APP_ID }} | |
| FLEET_APP_PRIVATE_KEY: ${{ secrets.FLEET_APP_PRIVATE_KEY }} | |
| FLEET_APP_INSTALLATION_ID: ${{ secrets.FLEET_APP_INSTALLATION_ID }} |