diff --git a/.github/scripts/pull-request-dashboard/test_rollout.py b/.github/scripts/pull-request-dashboard/test_rollout.py index deb30277bbc..cf9d35361b3 100644 --- a/.github/scripts/pull-request-dashboard/test_rollout.py +++ b/.github/scripts/pull-request-dashboard/test_rollout.py @@ -131,7 +131,13 @@ def test_repo_workflow_loads_code_from_its_own_commit(self) -> None: self.assertIn("code_ref:", body) self.assertEqual(body.count("inputs.code_ref"), 0) self.assertEqual(body.count("actions/checkout@"), 2) - self.assertEqual(body.count("path: live-config"), 2) + self.assertEqual(body.count("ref: ${{ github.sha }}"), 2) + self.assertNotIn("path: live-config", body) + self.assertNotIn("sparse-checkout:", body) + self.assertIn( + "DASHBOARD_CONFIG: .github/scripts/pull-request-dashboard/repositories.json", + body, + ) self.assertEqual(body.count("uses: $/.github/scripts/pull-request-dashboard"), 2) self.assertEqual( body.count("${{ steps.dashboard-code.outputs.path }}/.cache/classifications"), diff --git a/.github/workflows/pull-request-dashboard-repo.yml b/.github/workflows/pull-request-dashboard-repo.yml index a966bec58ad..22999061de9 100644 --- a/.github/workflows/pull-request-dashboard-repo.yml +++ b/.github/workflows/pull-request-dashboard-repo.yml @@ -29,7 +29,7 @@ permissions: contents: read env: - DASHBOARD_CONFIG: live-config/.github/scripts/pull-request-dashboard/repositories.json + DASHBOARD_CONFIG: .github/scripts/pull-request-dashboard/repositories.json DASHBOARD_STATE_BRANCH_PREFIX: otelbot/pull-request-dashboard-state jobs: @@ -45,19 +45,16 @@ jobs: outputs: initial_backfill_complete: ${{ steps.dashboard-update.outputs.initial_backfill_complete }} steps: + # `$` resolves this same-repository action from the reusable workflow's exact commit. - name: Load dashboard code id: dashboard-code uses: $/.github/scripts/pull-request-dashboard - # Repository configuration is deliberately read from the triggering - # commit: opting a repository in, or changing its settings, takes effect - # immediately on every rollout ref. + # The checkout supplies current repository configuration and the Git + # context used to manage dashboard state worktrees. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ github.sha }} - path: live-config - sparse-checkout: .github/scripts/pull-request-dashboard/repositories.json - sparse-checkout-cone-mode: false persist-credentials: false - name: Load repository configuration @@ -234,19 +231,16 @@ jobs: env: PUBLISHER_LOCK_OWNER: ${{ github.run_id }}-${{ github.run_attempt }}-publish steps: + # `$` resolves this same-repository action from the reusable workflow's exact commit. - name: Load dashboard code id: dashboard-code uses: $/.github/scripts/pull-request-dashboard - # Repository configuration is deliberately read from the triggering - # commit: opting a repository in, or changing its settings, takes effect - # immediately on every rollout ref. + # The checkout supplies current repository configuration and the Git + # context used to manage dashboard state worktrees. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ github.sha }} - path: live-config - sparse-checkout: .github/scripts/pull-request-dashboard/repositories.json - sparse-checkout-cone-mode: false persist-credentials: false - name: Load repository configuration