name: 'Trigger E2E'

on:
  workflow_dispatch:
    inputs:
      repo_name:
        description: 'Repository name (e.g., owner/repo)'
        required: false
        type: 'string'
      head_sha:
        description: 'SHA of the commit to test'
        required: false
        type: 'string'
  pull_request:

jobs:
  save_repo_name:
    if: "github.repository == 'google-gemini/gemini-cli'"
    runs-on: 'gemini-cli-ubuntu-16-core'
    steps:
      - name: 'Save Repo name'
        env:
          REPO_NAME: '${{ github.event.inputs.repo_name || github.event.pull_request.head.repo.full_name }}'
          HEAD_SHA: '${{ github.event.inputs.head_sha || github.event.pull_request.head.sha }}'
        run: |
          mkdir -p ./pr
          echo "${REPO_NAME}" > ./pr/repo_name
          echo "${HEAD_SHA}" > ./pr/head_sha
      - uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # ratchet:actions/upload-artifact@v4
        with:
          name: 'repo_name'
          path: 'pr/'
  trigger_e2e:
    name: 'Trigger e2e'
    if: "github.repository == 'google-gemini/gemini-cli'"
    runs-on: 'gemini-cli-ubuntu-16-core'
    steps:
      - id: 'trigger-e2e'
        run: |
          echo "Trigger e2e workflow"
