Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

Added test coverage for the nested destructuring pattern introduced in the previous refactoring:

const { eventName, actor, repo } = context;
const { owner, repo: repoName } = repo;

New Tests (4)

  • Custom owner/repo extraction - Validates nested destructuring correctly extracts owner and repoName from context.repo
  • Different repo name variations - Tests permission checks with various owner/repo/actor combinations
  • Safe event destructuring - Verifies destructuring works in early-return paths (workflow_dispatch, schedule, merge_group)
  • Special characters in repo names - Ensures hyphens and underscores in repo names are handled correctly

Coverage: 18/18 tests passing (14 original + 4 new)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Clean check_permissions.cjs for better clarity Add tests for context destructuring in check_permissions.cjs Jan 25, 2026
Copilot AI requested a review from pelikhan January 25, 2026 17:44
@pelikhan pelikhan marked this pull request as ready for review January 25, 2026 18:25
@pelikhan pelikhan merged commit fb2dda7 into jsweep-clean-check-permissions-c972a94c40363ff1 Jan 25, 2026
@pelikhan pelikhan deleted the copilot/sub-pr-11775 branch January 25, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants