question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Excluded sub directory not working

See original GitHub issue

Hey there! The README.md provides an example where an excluded sub-path is provided. Unfortunately that sub-path still ends up in the cache. Here is a modified example using the local maven repository.

- name: Cache multiple paths
  uses: actions/cache@v2
  with:
    path: |
      ~/.m2
      !~/.m2/pro/taskana
    key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

Reading out on the next (cached) build the files in ~/.m2/pro/taskana are contained in the cache. The following adjustment didn’t work either:

- name: Cache multiple paths
  uses: actions/cache@v2
  with:
    path: |
      ~/.m2
      !~/.m2/pro/taskana/**
    key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

Is this a bug or am I having the wrong expectations? Our current workaround is to delete that subfolder in a dedicated step. It works, but is kinda annoying.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
bigdazcommented, Oct 21, 2021

@dhadka Since it doesn’t appear that this issue will be resolved any time soon, I suggest that you update the example in the README. The current example is misleading since it won’t work as expected.

Changing ~/cache to ~/cache/* should be a functional example. ~/cache/* matches all subdirectories, and then !~/cache/exclude will exclude that particular subdirectory.

- name: Cache multiple paths
  uses: actions/cache@v2
  with:
    path: |
      ~/cache/*
      !~/cache/exclude
    key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
2reactions
dhadkacommented, Feb 8, 2021

@mustaphazorgati Thanks for reporting this (and sorry I didn’t see this earlier). I was able to reproduce this issue. I filed a bug over in the actions/toolkit repo that hosts the underlying logic for search patterns.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exclude sub directories from find: why is -not -path not working?
I'm trying to run simian and pass a file argument into it, but excluding a directory just isn't working. The Lib directory is...
Read more >
Exclude subdirectory not working with grep command
This works for me, in that it excludes the "foo" directory from the root directory of the search: grep -rn --exclude-dir=foo 'custom'.
Read more >
Exclude subdirectory pattern for the tree command not working
I want to exclude every files that match a gitignore pattern. The solution found here seems promising. Unfortunately it seems that the tree ......
Read more >
Exclude a subdirectory from the explorer using exact path ...
Steps to Reproduce: Create a directory public with a subdirectory bundle; Create a settings.json file under the .vscode directory; Add the ...
Read more >
Subdirectories are not excluded by Integrity Monitoring in the ...
As workaround, prevent subdirectories from being included to the baseline by putting an asterisk sign (*) to the Include Files With Names Like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found