Defer cache-memory updates until after successful threat detection#5778
Closed
Defer cache-memory updates until after successful threat detection#5778
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Modified cache-memory to use restore-only mode when threat detection enabled - Upload cache-memory artifacts in agent job (with if: always()) - Created update_cache_memory job that runs after successful detection - Added actions/cache/save@v4 action pin - Added UpdateCacheMemoryJobName constant Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Created comprehensive tests for cache-memory + threat-detection integration - Fixed artifact naming logic in update_cache_memory job to match upload logic - Updated test expectations to match actual compiled output - All unit tests passing Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Verified workflows with cache-memory + threat-detection use restore-only mode - Verified update_cache_memory job is created for workflows with both features - Verified workflows without threat-detection still use normal cache action - All workflow package tests passing - Linting and formatting passing Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Improved test documentation for action pin count - Code review completed with 4 minor suggestions - All suggestions are non-critical refactoring opportunities - Core functionality is correct and well-tested Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update compiler to manage cache updates correctly
Defer cache-memory updates until after successful threat detection
Dec 7, 2025
16 tasks
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.
Cache-memory was being updated in the agent job before threat detection completed, allowing potentially malicious content to persist. This change defers cache updates until after detection succeeds.
Changes
actions/cache/restore(read-only) when threat detection is enabled; uploads artifacts withif: always()update_cache_memoryjob: Runs after successful detection, downloads artifacts, saves to cache usingactions/cache/save@v4actions/cache(read+write) as beforeExample
Before (cache updated regardless of detection):
After (cache updated only after detection succeeds):
Multiple cache entries are handled correctly with consistent naming.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go b-ag�� s/ GO111MODULE ache/go/1.25.0/x64/pkg/tool/linujson GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x--json(http block)/usr/bin/gh gh api user --jq .login xe5-kBtB_ GO111MODULE epo GOINSECURE GOMOD GOMODCACHE ortcfg env edcfg GO111MODULE ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile(http block)/usr/bin/gh gh api user --jq .login entics.git GO111MODULE a141d60914e5923a579edacd3426772d749/log.json GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet env -json GO111MODULE 3789871/b355/styles.test GOINSECURE GOMOD GOMODCACHE 3789871/b355/sty-address(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 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.