Ensure workspace directory is accessible to copilot engine in threat detection job#1211
Closed
Copilot wants to merge 2 commits into
Closed
Ensure workspace directory is accessible to copilot engine in threat detection job#1211Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…ection job Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for workspace dir in detection job
Ensure workspace directory is accessible to copilot engine in threat detection job
Oct 3, 2025
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The threat detection job was unable to access workspace files when using the copilot engine. This occurred because:
$GITHUB_WORKSPACE--add-dir /tmp/without the workspace directoryThis meant the copilot engine in the detection job could not analyze repository files during threat detection, limiting its ability to understand the codebase context.
Solution
This PR adds workspace access to the copilot engine in two ways:
1. Added Checkout Step to Detection Job
The threat detection job now checks out the repository before running analysis:
2. Added Workspace Directory to Copilot CLI Arguments
The copilot engine now includes
$GITHUB_WORKSPACEin its--add-dirarguments:copilot --add-dir /tmp/ --add-dir "$GITHUB_WORKSPACE" --log-level all ...This change applies to both the main agent job and the threat detection job, ensuring consistent workspace access across all copilot executions.
Testing
Impact
This fix enables the threat detection job to properly analyze repository files when using the copilot engine, improving the security analysis capabilities of agentic workflows.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.