actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.49k stars 1.2k forks source link

Exclusions do not work #1215

Closed pauldraper closed 7 months ago

pauldraper commented 1 year ago

Exclusions do not work.

Example:

jobs:
  save:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/cache@v3
      with:
        path: |
          cache
          !cache/unwanted
        key: ${{ github.workflow }}/${{ github.run_number }}-${{ github.run_attempt }}
    - run: |
        mkdir -p cache/wanted cache/unwanted
        > cache/wanted/example.txt
        > cache/unwanted/example.txt
  restore:
    needs: [save]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/cache@v3
      with:
        fail-on-cache-miss: true
        path: |
          cache
          !cache/unwanted
        key: ${{ github.workflow }}/${{ github.run_number }}-${{ github.run_attempt }}
    - run: find cache > "$GITHUB_STEP_SUMMARY"
on: workflow_dispatch
name: Example

Outputs:

cache
cache/wanted
cache/wanted/example.txt
cache/unwanted
cache/unwanted/example.txt

Reference: https://github.com/actions/cache/blob/67b839edb68371cc5014f6cea11c9aa77238de78/examples.md#c---nuget

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 5 days since being marked as stale.

pauldraper commented 7 months ago

Reopen