diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index bc705df7..a008979b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,6 +1,11 @@ name: E2E Tests on: workflow_call: + inputs: + ref: + description: Commit SHA or ref to test + required: false + type: string schedule: - cron: "0 6 * * 1" # Weekly Monday 6 AM UTC workflow_dispatch: @@ -19,6 +24,8 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - uses: dtolnay/rust-toolchain@stable @@ -59,6 +66,8 @@ jobs: files: "tests/e2e/scenarios/test_owner_scope.py tests/e2e/scenarios/test_routine_event_batch.py" steps: - uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Download binary uses: actions/download-artifact@v4 diff --git a/.github/workflows/staging-ci.yml b/.github/workflows/staging-ci.yml index 2df7bf6f..99ee2bfc 100644 --- a/.github/workflows/staging-ci.yml +++ b/.github/workflows/staging-ci.yml @@ -62,7 +62,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - ref: staging + ref: ${{ github.sha }} fetch-depth: 0 fetch-tags: true @@ -117,6 +117,8 @@ jobs: needs: check-changes if: needs.check-changes.outputs.has_changes == 'true' uses: ./.github/workflows/test.yml + with: + ref: ${{ needs.check-changes.outputs.current_head }} # ── Run E2E browser tests ──────────────────────────────────────── e2e: @@ -124,6 +126,8 @@ jobs: needs: check-changes if: needs.check-changes.outputs.has_changes == 'true' uses: ./.github/workflows/e2e.yml + with: + ref: ${{ needs.check-changes.outputs.current_head }} # ── Create promotion PR (triggers claude-review.yml on the PR) ── create-promotion-pr: @@ -137,7 +141,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - ref: staging + ref: ${{ needs.check-changes.outputs.current_head }} fetch-depth: 0 - name: Generate GitHub App token @@ -163,7 +167,7 @@ jobs: PROMOTION_BASE: ${{ needs.resolve-promotion-base.outputs.promotion_base }} run: | git fetch origin "${PROMOTION_BASE}" - AHEAD=$(git rev-list --count "origin/${PROMOTION_BASE}..origin/staging") + AHEAD=$(git rev-list --count "origin/${PROMOTION_BASE}..HEAD") echo "commits_ahead=${AHEAD}" >> "$GITHUB_OUTPUT" if [ "$AHEAD" -eq 0 ]; then echo "Staging is not ahead of ${PROMOTION_BASE}. Nothing to promote." diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00488c70..db81e348 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,11 @@ name: Run Tests on: workflow_call: + inputs: + ref: + description: Commit SHA or ref to test + required: false + type: string pull_request: branches: - main @@ -28,6 +33,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -48,6 +55,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -71,6 +80,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Install Rust uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 @@ -96,6 +107,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Install Rust uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 @@ -113,6 +126,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -133,6 +148,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Install Rust uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 @@ -150,6 +167,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.sha }} - name: Build Docker image run: docker build -t ironclaw-test:ci . @@ -161,6 +180,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 with: + ref: ${{ inputs.ref || github.sha }} fetch-depth: 0 - name: Check version bumps for changed extensions env: