Skip to content

Suggested test: copilot/push-to-pull-request-branch-allowed-files-scoped-to-agent-commits #21344

Open

Description

@github-actions

Motivation

Link to the gh-aw PR: github/gh-aw#67241 — Fixes push-to-pull-request-branch's emit-time allowed-files policy check, which previously scanned commits from the PR's base branch (including pre-existing, author-owned commits already on the PR) instead of only the agent's new commits from the existing PR head to the pushed tip. This could wrongly reject an allowed agent change because of unrelated earlier commits.

Proposed test

  • Workflow file: test-copilot-push-to-pull-request-branch-allowed-files.md
  • Trigger: workflow_dispatch (matching the existing dispatch-based push tests)
  • Engine: copilot
  • Safe output: push-to-pull-request-branch
  • Variant: standard

Minimal test prompt sketch

Pre-create a PR whose branch already has a commit touching a file outside any allowed-files pattern (e.g. README.md), then configure push-to-pull-request-branch: { allowed-files: [".changeset/**"] }. Have the agent add only a .changeset/*.md file and push. Assert the push succeeds (new commit lands, PR updated) despite the pre-existing out-of-scope commit on the branch — proving the policy only scans the agent's new commits, not the full base-to-tip range.

New fixtures or secrets needed

None — reuses the existing dispatch-triggered PR fixture pattern from test-copilot-push-to-pull-request-branch-using-dispatch.md, with an extra setup step to seed a pre-existing out-of-scope commit on the PR branch before dispatch.

Notes

No existing test in existing-tests.json configures allowed-files on push-to-pull-request-branch at all, so this also adds first-time coverage for the allowed-files option itself, not just the regression fix.

Generated by 🔍 Suggest New E2E Tests · copilot · auto · 133.2 AIC · ⌖ 7.05 AIC · ⊞ 8.6K · ◷

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