Skip to content

Add test-copilot-push-to-pull-request-branch-allowed-files #4417

Description

@github-actions

Caution

Protected files were modified in this change.
This pull request is in request_review mode and requires explicit human scrutiny before merge.

Protected files: .github/workflows/test-copilot-push-to-pull-request-branch-allowed-files.md

Motivation

github/gh-aw#41937fix(changeset): restrict safe-outputs allowed-files to .changeset/*.md revealed that the allowed-files configuration option on push-to-pull-request-branch is used in production but has no regression test in the E2E suite.

What this adds

A new workflow_dispatch-triggered test that exercises push-to-pull-request-branch with allowed-files: ["*.md"]. The agent is asked to create and push a single Markdown file; the pre-canned sample contains a .md patch that passes the allowed-files filter.

This verifies:

  1. The allowed-files config compiles correctly into the lock file
  2. The safe-output handler accepts patches whose files match the allowed pattern (happy path)

Next steps for a reviewer

  • Run gh aw compile .github/workflows/test-copilot-push-to-pull-request-branch-allowed-files.md to generate the lock file and commit it
  • Add test-copilot-push-to-pull-request-branch-allowed-files to get_all_tests() in e2e.sh under the workflow_dispatch section (alongside the other push-to-pull-request-branch dispatch tests)

Generated by 🔍 Suggest New E2E Tests · 110.8 AIC · ⌖ 11.6 AIC · ⊞ 5.9K ·


Note

This was originally intended as a pull request, but the git push operation failed.

Original error: pushSignedCommits: refusing unsigned push for branch 'suggest-test-push-allowed-files-146d9d89f9c8f37d': Signed-commit payload violates file-protection policy (request_review): .github/workflows/test-copilot-push-to-pull-request-branch-allowed-files.md

Workflow Run: View run details and download bundle artifact

The bundle file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 28318008590 -n agent -D /tmp/agent-28318008590

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-28318008590/aw-suggest-test-push-allowed-files.bundle refs/heads/suggest-test-push-allowed-files:refs/bundles/create-pr-suggest-test-push-allowed-files-146d9d89f9c8f37d-dc61d872
git update-ref refs/heads/suggest-test-push-allowed-files-146d9d89f9c8f37d refs/bundles/create-pr-suggest-test-push-allowed-files-146d9d89f9c8f37d-dc61d872
git checkout suggest-test-push-allowed-files-146d9d89f9c8f37d
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-suggest-test-push-allowed-files-146d9d89f9c8f37d-dc61d872

# Push the branch to origin
git push origin suggest-test-push-allowed-files-146d9d89f9c8f37d

# Create the pull request
gh pr create --title 'Add test-copilot-push-to-pull-request-branch-allowed-files' --base main --head suggest-test-push-allowed-files-146d9d89f9c8f37d --repo githubnext/gh-aw-test

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions