Skip to content

Suggested test: copilot/pull-request-activation-base-sha-pinning #18367

Open

Description

@github-actions

Motivation

Link to the gh-aw PR: github/gh-aw#63499 — Pins the activation-job sparse checkout ref: to the PR base SHA (not PR head) when a workflow includes a pull_request trigger, preventing a same-repo PR author from influencing runtime-imported instructions/skills used to review their own PR (fixes github/gh-aw#63469).

Proposed test

  • Workflow file: test-copilot-pull-request-activation-base-sha.md
  • Trigger: pull_request (types: opened, synchronize)
  • Engine: copilot
  • Safe output: add-comment (simplest observable signal)
  • Variant: standard

Minimal test prompt sketch

Author a workflow with a pull_request trigger that imports a runtime file (e.g. via imports: or an included instructions snippet) containing a sentinel string. In the test PR's head branch, modify that imported file to contain a different, "poisoned" sentinel. Have the agent report which sentinel value it observed via add-comment. Assert the comment shows the base-branch sentinel, proving the activation checkout used the PR base SHA rather than the head.

New fixtures or secrets needed

None — reuses existing create_test_pr/create_test_pr_with_branch harness helpers already used by test-copilot-close-pull-request.md and similar PR-triggered tests.

Notes

No existing pull_request-triggered test exercises runtime-import/activation-checkout content; existing PR-triggered tests (close-pull-request, update-pull-request, add-reviewer, mark-pull-request-as-ready-for-review) only check safe-output behavior on PR metadata, not activation-checkout provenance. Not present in fails.txt or open suggestions. Open question: confirming the simplest way to make the imported-file sentinel diverge between base and head without an actual security bypass attempt — may need a fixture file already present in main that the test PR modifies.

Generated by 🔍 Suggest New E2E Tests · copilot · auto · 65.1 AIC · ⌖ 9.43 AIC · ⊞ 8.5K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions