debug: verbose curl headers, force v1 save

This commit is contained in:
Hermes
2026-05-02 21:12:05 -07:00
parent a0a0c01217
commit 96df067726

View File

@@ -44,6 +44,8 @@ runs:
- name: Save cache - name: Save cache
id: cache-save id: cache-save
env:
ACTIONS_CACHE_SERVICE_V2: "0"
uses: https://gitea.com/actions/cache@v3 uses: https://gitea.com/actions/cache@v3
with: with:
path: | path: |
@@ -55,6 +57,15 @@ runs:
key: rust-linux-${{ steps.cache-key.outputs.hash }} key: rust-linux-${{ steps.cache-key.outputs.hash }}
save-always: true save-always: true
- name: Debug: print save outputs
shell: bash
run: |
echo "=== Save action outputs ==="
echo "cache-hit: '${{ steps.cache-save.outputs.cache-hit }}'"
echo "key: '${{ steps.cache-save.outputs.key }}'"
echo "=== All outputs ==="
env | grep -i ACTIONS_CACHE || echo "No ACTIONS_CACHE env vars in shell"
- name: Twirp probe via curl (debug) - name: Twirp probe via curl (debug)
shell: bash shell: bash
env: env:
@@ -65,17 +76,27 @@ runs:
echo "=== Cache env vars ===" echo "=== Cache env vars ==="
echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL"
echo "ACTIONS_RUNTIME_TOKEN len=${#ACTIONS_RUNTIME_TOKEN}" echo "ACTIONS_RUNTIME_TOKEN len=${#ACTIONS_RUNTIME_TOKEN}"
echo "ACTIONS_RESULTS_URL=$ACTIONS_RESULTS_URL"
if [ -n "$ACTIONS_CACHE_URL" ]; then if [ -n "$ACTIONS_CACHE_URL" ]; then
echo "=== Twirp probe (v1): GetCacheEntryDownloadURL ===" HASH="${{ steps.cache-key.outputs.hash }}"
BODY=$(printf '{"key":"rust-linux-%s","restoreKeys":[],"version":"%s"}' "$HASH" "$HASH") KEY="rust-linux-$HASH"
RESP=$(curl -s -X POST \ echo "=== Twirp v1: GetCacheEntryDownloadURL ==="
BODY=$(printf '{"key":"%s","restoreKeys":[],"version":"%s"}' "$KEY" "$HASH")
echo "POST $ACTIONS_CACHE_URL/twirp/github.actions.results.api.v1.CacheService/GetCacheEntryDownloadURL"
echo "Body: $BODY"
RESP=$(curl -si -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer $ACTIONS_RUNTIME_TOKEN" \ -H "Authorization: Bearer $ACTIONS_RUNTIME_TOKEN" \
"$ACTIONS_CACHE_URL/twirp/github.actions.results.api.v1.CacheService/GetCacheEntryDownloadURL" \ "$ACTIONS_CACHE_URL/twirp/github.actions.results.api.v1.CacheService/GetCacheEntryDownloadURL" \
-d "$BODY" \ -d "$BODY" \
-w "\nHTTP_STATUS:%{http_code}" 2>&1) 2>&1)
echo "$RESP" echo "$RESP"
echo ""
echo "=== Also try list cache API ==="
LIST_RESP=$(curl -si \
-H "Authorization: Bearer $ACTIONS_RUNTIME_TOKEN" \
"$ACTIONS_CACHE_URL/_apis/artifactcache/caches?key=$KEY&version=$HASH" \
2>&1)
echo "$LIST_RESP"
else else
echo "ACTIONS_CACHE_URL is empty" echo "ACTIONS_CACHE_URL is empty"
fi fi