[GH-ISSUE #286] act is not respecting "if: steps.bincache.outputs.cache-hit != true" #201

Closed
opened 2026-03-01 21:41:09 +03:00 by kerem · 1 comment
Owner

Originally created by @grische on GitHub (Jun 20, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/286

I am trying to use the following actions files, but unfortunately even though actions/cache@v2 always fails and sets ::set-output:: cache-hit=false, the following step Download binaries is never executed.

on: push

jobs:
  cache_test:
    runs-on: ubuntu-18.04
    steps:
      - name: Downloads cache
        uses: actions/cache@v2
        id: bincache
        with:
          path: mybins
          key: ${{ runner.os }}-${{ hashFiles('**/tools/utils/download_bins.sh') }}

      - name: Download binaries
        if: steps.bincache.outputs.cache-hit != 'true'
        run: bash tools/utils/download_bins.sh

$ act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 push
[cache-test.yaml/cache_test] 🚀  Start image=nektos/act-environments-ubuntu:18.04
[cache-test.yaml/cache_test]   🐳  docker run image=nektos/act-environments-ubuntu:18.04 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[cache-test.yaml/cache_test] ⭐   Run Downloads cache
[cache-test.yaml/cache_test]   ☁  git clone 'https://github.com/actions/cache' # ref=v2
[cache-test.yaml/cache_test]   🐳  docker cp src=/home/grische/.cache/act/actions-cache@v2 dst=/actions/
[cache-test.yaml/cache_test]   ❓   ::save-state name=CACHE_KEY::Linux-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[cache-test.yaml/cache_test]   💬  ::debug::Resolved Keys:
[cache-test.yaml/cache_test]   💬  ::debug::["Linux-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"]
[cache-test.yaml/cache_test]   💬  ::debug::Checking zstd --version
[cache-test.yaml/cache_test]   💬  ::debug::Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
[cache-test.yaml/cache_test]   💬  ::debug::
[cache-test.yaml/cache_test]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[cache-test.yaml/cache_test]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
| [warning]getCacheEntry failed: Cache Service Url not found, unable to restore cache.
[cache-test.yaml/cache_test]   ⚙  ::set-output:: cache-hit=false
[cache-test.yaml/cache_test]   ✅   Success - Downloads cache

Running with act -v, also outputs the following line:

...
DEBU[0000] Skipping step 'Download binaries' due to 'steps.bincache.outputs.cache-hit != 'true''
[cache-test.yaml/cache_test] Removed container: 6ad084f888312c4c97e32bf16b2ec4e07ece7b68da5aed4934fe6e731a047a55
[cache-test.yaml/cache_test]   🐳  docker volume rm act-pull-requests-yml-cache-test
Originally created by @grische on GitHub (Jun 20, 2020). Original GitHub issue: https://github.com/nektos/act/issues/286 I am trying to use the following actions files, but unfortunately even though `actions/cache@v2` always fails and sets `::set-output:: cache-hit=false`, the following step `Download binaries` is never executed. ```yaml on: push jobs: cache_test: runs-on: ubuntu-18.04 steps: - name: Downloads cache uses: actions/cache@v2 id: bincache with: path: mybins key: ${{ runner.os }}-${{ hashFiles('**/tools/utils/download_bins.sh') }} - name: Download binaries if: steps.bincache.outputs.cache-hit != 'true' run: bash tools/utils/download_bins.sh ``` ``` $ act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 push [cache-test.yaml/cache_test] 🚀 Start image=nektos/act-environments-ubuntu:18.04 [cache-test.yaml/cache_test] 🐳 docker run image=nektos/act-environments-ubuntu:18.04 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [cache-test.yaml/cache_test] ⭐ Run Downloads cache [cache-test.yaml/cache_test] ☁ git clone 'https://github.com/actions/cache' # ref=v2 [cache-test.yaml/cache_test] 🐳 docker cp src=/home/grische/.cache/act/actions-cache@v2 dst=/actions/ [cache-test.yaml/cache_test] ❓ ::save-state name=CACHE_KEY::Linux-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 [cache-test.yaml/cache_test] 💬 ::debug::Resolved Keys: [cache-test.yaml/cache_test] 💬 ::debug::["Linux-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"] [cache-test.yaml/cache_test] 💬 ::debug::Checking zstd --version [cache-test.yaml/cache_test] 💬 ::debug::Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable. [cache-test.yaml/cache_test] 💬 ::debug:: [cache-test.yaml/cache_test] 💬 ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache. [cache-test.yaml/cache_test] 💬 ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache. | [warning]getCacheEntry failed: Cache Service Url not found, unable to restore cache. [cache-test.yaml/cache_test] ⚙ ::set-output:: cache-hit=false [cache-test.yaml/cache_test] ✅ Success - Downloads cache ``` Running with `act -v`, also outputs the following line: ``` ... DEBU[0000] Skipping step 'Download binaries' due to 'steps.bincache.outputs.cache-hit != 'true'' [cache-test.yaml/cache_test] Removed container: 6ad084f888312c4c97e32bf16b2ec4e07ece7b68da5aed4934fe6e731a047a55 [cache-test.yaml/cache_test] 🐳 docker volume rm act-pull-requests-yml-cache-test ```
kerem 2026-03-01 21:41:09 +03:00
Author
Owner

@cplee commented on GitHub (Jun 23, 2020):

dup #104

<!-- gh-comment-id:648290537 --> @cplee commented on GitHub (Jun 23, 2020): dup #104
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#201
No description provided.