Skip to content

Comments

Fix update_cache_memory job when cache folder is empty#16779

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-upload-cache-step-error
Feb 19, 2026
Merged

Fix update_cache_memory job when cache folder is empty#16779
pelikhan merged 3 commits intomainfrom
copilot/fix-upload-cache-step-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

The update_cache_memory job's download-artifact step has continue-on-error: true but validation and save steps execute unconditionally, causing failures when the cache is empty.

Changes

  • Add step ID to download-artifact for tracking download state
  • Add cache content check step that sets has_content output based on folder existence and content
  • Make validation conditional on steps.check_cache_*.outputs.has_content == 'true'
  • Make save conditional on steps.check_cache_*.outputs.has_content == 'true'

Implementation

- name: Download cache-memory artifact (default)
  id: download_cache_default
  uses: actions/download-artifact@...
  continue-on-error: true

- name: Check if cache-memory folder has content (default)
  id: check_cache_default
  shell: bash
  run: |
    if [ -d "/tmp/gh-aw/cache-memory" ] && [ "$(ls -A /tmp/gh-aw/cache-memory 2>/dev/null)" ]; then
      echo "has_content=true" >> $GITHUB_OUTPUT
    else
      echo "has_content=false" >> $GITHUB_OUTPUT
    fi

- name: Save cache-memory to cache (default)
  if: steps.check_cache_default.outputs.has_content == 'true'
  uses: actions/cache/save@...

Works for both single cache (default) and multiple named caches.

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/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go k/gh�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go ache�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go env ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683 --jq .object.sha 4U0C/QrgobKApfHvGOSUMDB GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 6808159/b385/impconfig -c k/gh-aw/gh-aw/pkremote.origin.url k/gh-aw/gh-aw/pkg/mathutil/mathuGOMOD 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcconfig (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha k/gh-aw/gh-aw/.github/workflows ache/go/1.25.0/xGO111MODULE p/bin/basename l om> DiscussionsEnabl--show-toplevel git s/ag�� 4943-31911/test-1667868586/.github/workflows rev-parse cfg github/workflowsgit GO111MODULE 64/bin/go gh (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha vaScript325294525/001/test-empty-frontmatter.md prettier Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle scripts/**/*.js --ignore-path $name) { has--show-toplevel iptables -w -t security /home/REDACTED/.cargo/bin/bash OUTPUT -d 168.63.129.16 bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.g-errorsas rev-parse /home/REDACTED/work/_temp/ghcca-no-nilfunc --check scripts/**/*.js 64/bin/go bash --no�� runs/20260219-074943-31911/test-1756128252/.github/workflows go 874899/b274/vet.cfg -json GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha k/gh-aw/gh-aw/.github/workflows/bot-detection.md -trimpath /usr/bin/git -p main -lang=go1.25 git init�� 1c2I-bybPy3xbEtErTH5/1c2I-bybPy3xbEtErTH5 -dwarf=false /usr/bin/git go1.25.0 -c=4 -nolocalimports git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha k/gh-aw/gh-aw/.github/workflows GO111MODULE /usr/bin/infocmp GOINSECURE GOMOD ed } } infocmp -1 xterm-color GOPROXY x_amd64/compile er.lock.yml | he/opt/hostedtoolcache/node/24.13.0/x64/bin/node GOWORK DiscussionsEnablSafe: ${{ github.actor }}, Unsafe: ${{ secrets.TOKEN }} x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha r-test2796243027/test1.md r-test2796243027/test2.lock.yml /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -o /tmp/go-build954874899/b389/_pkg_.a -trimpath /usr/bin/git -p github.com/githurev-parse -lang=go1.25 git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha .github/workflows/test.md go /opt/hostedtoolcache/node/24.13.0/x64/bin/node -json GO111MODULE /opt/hostedtoolc--show-toplevel node /tmp�� /tmp/TestHashStability_SameInputSameOutput3596055069/001/stability-test.md go /usr/bin/git ub/workflows GO111MODULE me: String!) { --show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh -c "prettier" --check '**/*.cjs' '*GOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go /opt/hostedtoolc-f (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha prettier --check 64/bin/go **/*.ts **/*.json --ignore-path /opt/hostedtoolc-f -V=f�� erignore git 64/bin/go -d -v 64/bin/go go (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha cache_memory:" .github/workflows/archie.md.lock.yml | head -60 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env b/workflows/archie.lock.yml | head -60 GO111MODULE repository(owner: $owner, name:-f GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -A50 "update_cache_memory:" .github/workflows/chroma-issue-indexer.md.lock.yml | head -60 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env emory:" .github/workflows/chroma-issue-indexer.lock.yml | head -60 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c --jq .object.sha k/gh-aw/gh-aw/scripts/lint_errorGOINSECURE --check 64/bin/go **/*.ts **/*.json --ignore-path /opt/hostedtoolcrev-parse -o /tmp/go-build1446808159/b369/_pkGOINSECURE -trimpath 64/bin/go -d github.com/githu-C -lang=go1.25 go (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.github/workflows config 64/pkg/tool/linux_amd64/link remote.origin.urgit scripts/**/*.js $name) { has--show-toplevel 64/pkg/tool/linux_amd64/link -w util.test security rtcfg.link OUTPUT -d 168.63.129.16 FpiJ9ENbZatjTay5oJ/BhqTCoRMGewfss9ZXZGY/X4XoDkfiiEtxJ64HjgrP (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha GOMODCACHE x_amd64/cgo /usr/bin/git ithub/workflows GO111MODULE er: String!, $na--show-toplevel git rev-�� gh-aw/actions/setup/sh/sanitize_path.sh' '/usr/bin:/usr/local/bin:::' && echo "$PATH" 51RFpkM/6HJcGCc2/tmp/go-build954874899/b109/vet.cfg /usr/bin/git k/gh-aw/gh-aw/.g/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link GO111MODULE /usr/bin/gh git (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v5 --jq .object.sha 6808159/b390/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/repobuild GOMODCACHE go env g3kM/JaVzlJ_Otbagh-aw GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 6808159/b390/imprev-parse (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v5 --jq .object.sha 6808159/b394/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/stri-c GOMODCACHE go env H-p0/9qNQayvBt5H-n1 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 6808159/b394/imprev-parse (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go k/gh�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE erignore env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha ripts/lint_errorGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 6808159/b369/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/cli/--norc GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha vaScript325294525/001/test-simple-frontmatter.md config /usr/sbin/iptables remote.origin.urgit scripts/**/*.js 64/bin/go iptables -w -t security /usr/local/.ghcup/bin/bash OUTPUT -d 168.63.129.16 bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha Safe: ${{ github.actor }}, Unsafe: ${{ secrets.TOKEN }} x_amd64/compile /usr/bin/infocmp ithub/workflows GO111MODULE /opt/hostedtoolc--show-toplevel infocmp -1 gh-aw/actions/setup/sh/sanitize_path.sh' '/usr/bin:/usr/local/bin:' && echo "$PATH" go /usr/bin/git k/gh-aw/gh-aw/.ggcc GO111MODULE ndor/bin/bash git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go k/gh�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 6808159/b346/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/math-V=full GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha --check **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.prettixterm-color go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/anchore/sbom-action/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/anchore/sbom-action/git/ref/tags/v0 --jq .object.sha npx prettier --cremote.origin.url GOPROXY $name) { hasDiscussionsEnabled } } GOSUMDB GOWORK 64/bin/go go list�� -mod=readonly -e 64/bin/go -d -v 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/anchore/sbom-action/git/ref/tags/v0 --jq .object.sha prettier --check $name) { hasDiscussionsEnabled } } **/*.ts **/*.json --ignore-path gcc -###�� -x c 64/bin/go -d -v 64/bin/go go (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v6 --jq .object.sha npx prettier --check '**/*.cjs' GOINSECURE GOPROXY $name) { hasDiscussionsEnabled } } GOSUMDB GOWORK 64/bin/go go list�� -mod=readonly -f 64/bin/go -d unsafe 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v6 --jq .object.sha prettier --check 64/bin/go **/*.ts **/*.json --ignore-path /opt/hostedtoolcrev-parse -o /tmp/go-build1446808159/b346/_pkGOINSECURE -trimpath 64/bin/go -p github.com/githu-C -lang=go1.25 go (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq .object.sha npx prettier --check '**/*.cjs' GOINSECURE GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go git -c log.showsignature=false log 64/bin/go -d -v 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq .object.sha k/gh-aw/gh-aw/in-f --check 64/bin/go **/*.ts **/*.json --ignore-path /opt/hostedtoolcrev-parse -o /tmp/go-build1446808159/b345/_pkGOINSECURE -trimpath 64/bin/go -p main -lang=go1.25 go (http block)
  • https://api.github.com/repos/docker/metadata-action/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v5 --jq .object.sha npx prettier --cremote.origin.url GOPROXY 64/bin/go GOSUMDB GOWORK 64/bin/go git -c log.showsignatur-f log 64/bin/go -d --format=format:-C b30031dda5d6f3e7/home/REDACTED/work/gh-aw/gh-aw/.github/workflows go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v5 --jq .object.sha prettier --check 64/bin/go **/*.ts **/*.json --ignore-path git -c log.showsignature=false log 64/bin/go -d --format=format:-1 b30031dda5d6 go (http block)
  • https://api.github.com/repos/docker/setup-buildx-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha /gh-aw GOPROXY 64/bin/go GOSUMDB GOWORK run-script/lib/ngraphql go env -json GOMOD 64/bin/go -d (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha pkg/mod/github.com/aymanbagabas/GOINSECURE pkg/mod/github.com/aymanbagabas/GOMOD 64/bin/go **/*.ts **/*.json --ignore-path /opt/hostedtoolc-f -o /tmp/go-build144-f -trimpath 64/bin/go -p main -lang=go1.25 go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 o-authored-by: pelikhan <4175913-ifaceassert x_amd64/compile 60 GOMOD ed } } x_amd64/compile env matter-with-arrays.md GO111MODULE 0/x64/bin/basename GOINSECURE GOMOD ed } } /opt/hostedtoolcremote.origin.url (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE x_amd64/compile 60 GOMOD GOMODCACHE x_amd64/compile env k/gh-aw/gh-aw/.github/workflows GO111MODULE /usr/bin/git l GOMOD GOMODCACHE git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE x_amd64/compile 60 GOMOD GOMODCACHE x_amd64/compile env k/gh-aw/gh-aw/.github/workflows GO111MODULE /usr/bin/git GOINSECURE GOMOD DiscussionsEnabluser.email git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 o-authored-by: pelikhan <4175913-ifaceassert 64/bin/sh 60 GOMOD GOMODCACHE go env t-persona-explor-errorsas GO111MODULE de/node/bin/base-nilfunc GOINSECURE GOMOD GOMODCACHE ./gh-aw (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 o-authored-by: pelikhan <4175913-ifaceassert 0/x64/bin/sh 60 GOMOD GOMODCACHE go env t-persona-explorer.md ===" && grep -A50 "update_cache_memory:" .github/workflows/agent-persona-enode GO111MODULE (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 o-authored-by: pelikhan <4175913-ifaceassert de/node/bin/sh GOINSECURE GOMOD DiscussionsEnabluser.email go env t-persona-explorer.md ===" && grremote.origin.url GO111MODULE (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 o-authored-by: pelikhan <4175913main /opt/hostedtoolcache/go/1.25.0/x-lang=go1.25 l GOMOD ed } } go env t-persona-explorer.md ===" && gr-c=4 GO111MODULE er: String!, $name: String!) { -importcfg GOINSECURE GOMOD ed } } git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE SEyIUBuPec10 env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE go env ithub/workflows GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE x_amd64/vet env k/gh-aw/gh-aw/.github/workflows GO111MODULE de/node/bin/sh GOINSECURE GOMOD GOMODCACHE bash (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE /bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha ithub/workflows GO111MODULE ndor/bin/basename GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.0/xrev-parse expl�� 1667868586/.github/workflows -buildtags (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha 6808159/b375/_pkGOINSECURE GO111MODULE $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go env G5qJ/QtvYYGylzzR-buildmode=exe GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 6808159/b375/imp-f (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha k/gh-aw/gh-aw/.g.github/workflows/test.md GO111MODULE ame GOINSECURE GOMOD GOMODCACHE bash expl�� k/gh-aw/gh-aw/.github/workflows GOPROXY (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion l GOMOD GOMODCACHE x_amd64/vet env ma-issue-indexer.md ===" && grep -A50 "update_cache_memory:" .github/workflows/chroma-issue-inde/usr/bin/git GO111MODULE ndor/bin/sh GOINSECURE GOMOD GOMODCACHE IKEP8dB/iAJz33n4qBSgoBRlrikz (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env -json GO111MODULE repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build954874899/b368/cli.test /tmp/go-build954874899/b368/cli.test -test.testlogfile=/tmp/go-build954874899/b368/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go env cache_memory:" .github/workflows/archie.md.lock.yml | head -60 GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE 0/x64/bin/bash GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

The download-artifact in the upload-cache-memory job may fail when the cache was empty and not created. Make as ignore errors and skip uploading the upload-cache step if the folder is empty.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 19, 2026 07:47
- Add step ID to download-artifact step for tracking
- Add check step to determine if cache folder has content
- Add conditional to validation step to skip if folder is empty
- Add conditional to save step to skip if folder is empty

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error handling in upload-cache-memory job Fix update_cache_memory job when cache folder is empty Feb 19, 2026
@pelikhan pelikhan marked this pull request as ready for review February 19, 2026 07:54
Copilot AI review requested due to automatic review settings February 19, 2026 07:54
@pelikhan pelikhan merged commit bd69a3d into main Feb 19, 2026
148 checks passed
@pelikhan pelikhan deleted the copilot/fix-upload-cache-step-error branch February 19, 2026 07:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes update_cache_memory job failures when the cache-memory artifact is missing/empty by only validating/saving when the downloaded cache directory exists and contains files.

Changes:

  • Generate per-cache step IDs for cache-memory download/check steps.
  • Add a bash step to detect whether each cache-memory directory has content and gate subsequent steps on that output.
  • Regenerate workflow lock files to include the new check step and conditional cache save.

Reviewed changes

Copilot reviewed 65 out of 65 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/workflow/cache.go Adds cache-directory content check and conditions validation/save steps on has_content.
.github/workflows/weekly-issue-summary.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/unbloat-docs.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/test-create-pr-error-handling.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/technical-doc-writer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/super-linter.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/step-name-alignment.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/static-analysis-report.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/stale-repo-identifier.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/smoke-copilot.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/smoke-codex.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/smoke-claude.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/slide-deck-maintainer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/sergo.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/security-review.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/scout.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/schema-consistency-checker.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/safe-output-health.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/repository-quality-improver.lock.yml Updates generated multi-cache update_cache_memory steps with per-cache IDs, check step, and conditional save.
.github/workflows/repo-audit-analyzer.lock.yml Updates generated multi-cache update_cache_memory steps with per-cache IDs, check step, and conditional save.
.github/workflows/q.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/python-data-charts.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/prompt-clustering-analysis.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/pr-nitpick-reviewer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/portfolio-analyst.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/poem-bot.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/pdf-summary.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/org-health-report.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/mcp-inspector.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/lockfile-stats.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/jsweep.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/instructions-janitor.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/grumpy-reviewer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/gpclean.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/go-logger.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/go-fan.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/glossary-maintainer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/github-mcp-tools-report.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/github-mcp-structural-analysis.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/firewall-escape.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/developer-docs-consolidator.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/deep-report.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-safe-output-optimizer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-repo-chronicle.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-performance-summary.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-news.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-mcp-concurrency-analysis.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-issues-report.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-firewall-report.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-doc-updater.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-copilot-token-report.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-compiler-quality.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/daily-code-metrics.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/copilot-session-insights.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/copilot-agent-analysis.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/code-scanning-fixer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/cloclo.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/cli-version-checker.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/claude-code-user-docs-review.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/ci-doctor.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/ci-coach.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/audit-workflows.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.
.github/workflows/agent-persona-explorer.lock.yml Updates generated update_cache_memory job to add cache content check and conditional save.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +720 to +735
// Generate a safe step ID from cache ID (replace hyphens with underscores)
downloadStepID := strings.ReplaceAll(fmt.Sprintf("download_cache_%s", cache.ID), "-", "_")
fmt.Fprintf(&downloadStep, " - name: Download cache-memory artifact (%s)\n", cache.ID)
fmt.Fprintf(&downloadStep, " id: %s\n", downloadStepID)
fmt.Fprintf(&downloadStep, " uses: %s\n", GetActionPin("actions/download-artifact"))
downloadStep.WriteString(" continue-on-error: true\n")
downloadStep.WriteString(" with:\n")
fmt.Fprintf(&downloadStep, " name: %s\n", artifactName)
fmt.Fprintf(&downloadStep, " path: %s\n", cacheDir)
steps = append(steps, downloadStep.String())

// Check if cache folder exists and is not empty
var checkStep strings.Builder
checkStepID := strings.ReplaceAll(fmt.Sprintf("check_cache_%s", cache.ID), "-", "_")
fmt.Fprintf(&checkStep, " - name: Check if cache-memory folder has content (%s)\n", cache.ID)
fmt.Fprintf(&checkStep, " id: %s\n", checkStepID)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache.ID is only sanitized by replacing hyphens with underscores when generating step ids. Since cache IDs are user-provided and not validated for character set, IDs containing characters like ., whitespace, or other punctuation can produce invalid GitHub Actions step IDs and/or break steps.<id>.outputs... references. Also, different cache IDs can collide after this transformation (e.g. foo-bar vs foo_bar). Consider introducing a dedicated sanitizer for step IDs (restrict to [A-Za-z0-9_]), and validate that the resulting step IDs are unique across caches (or append a short hash/suffix to guarantee uniqueness).

Copilot uses AI. Check for mistakes.
Comment on lines +736 to +742
checkStep.WriteString(" shell: bash\n")
checkStep.WriteString(" run: |\n")
fmt.Fprintf(&checkStep, " if [ -d \"%s\" ] && [ \"$(ls -A %s 2>/dev/null)\" ]; then\n", cacheDir, cacheDir)
checkStep.WriteString(" echo \"has_content=true\" >> $GITHUB_OUTPUT\n")
checkStep.WriteString(" else\n")
checkStep.WriteString(" echo \"has_content=false\" >> $GITHUB_OUTPUT\n")
checkStep.WriteString(" fi\n")
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated bash check uses ls -A %s without quoting the path. Because cacheDir is derived from cache.ID (which isn't validated here), paths containing spaces or shell metacharacters can break the command or yield incorrect results. Quote the path (and preferably use --), and consider also quoting $GITHUB_OUTPUT to avoid word-splitting issues.

Copilot uses AI. Check for mistakes.
Comment on lines 731 to 789
@@ -743,9 +760,10 @@ func (c *Compiler) buildUpdateCacheMemoryJob(data *WorkflowData, threatDetection
fmt.Fprintf(&validationScript, " core.setFailed(`File type validation failed: Found ${result.invalidFiles.length} file(s) with invalid extensions. Only %s are allowed.`);\n", strings.Join(cache.AllowedExtensions, ", "))
validationScript.WriteString(" }\n")

// Generate validation step using helper
// Generate validation step using helper with condition to only run if cache has content
stepName := fmt.Sprintf("Validate cache-memory file types (%s)", cache.ID)
steps = append(steps, generateInlineGitHubScriptStep(stepName, validationScript.String(), ""))
condition := fmt.Sprintf("steps.%s.outputs.has_content == 'true'", checkStepID)
steps = append(steps, generateInlineGitHubScriptStep(stepName, validationScript.String(), condition))
}

// Generate cache key (same logic as in generateCacheMemorySteps)
@@ -764,9 +782,10 @@ func (c *Compiler) buildUpdateCacheMemoryJob(data *WorkflowData, threatDetection
cacheKey = cacheKey + runIdSuffix
}

// Save to cache step
// Save to cache step - only run if cache has content
var saveStep strings.Builder
fmt.Fprintf(&saveStep, " - name: Save cache-memory to cache (%s)\n", cache.ID)
fmt.Fprintf(&saveStep, " if: steps.%s.outputs.has_content == 'true'\n", checkStepID)
fmt.Fprintf(&saveStep, " uses: %s\n", GetActionPin("actions/cache/save"))
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces new behavior (skipping validation/save when the cache folder is empty) but there are existing integration tests for update_cache_memory generation (e.g., cache-memory threat detection tests) that don't assert the presence of the new check step nor the new if: conditions. Adding assertions for the check_cache_* step and the conditional if: steps.check_cache_*.outputs.has_content == 'true' would prevent regressions.

Copilot uses AI. Check for mistakes.
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