Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore cache failed: Dependencies file is not found #36

Open
jason-riddle opened this issue Feb 19, 2024 · 2 comments
Open

Restore cache failed: Dependencies file is not found #36

jason-riddle opened this issue Feb 19, 2024 · 2 comments

Comments

@jason-riddle
Copy link

jason-riddle commented Feb 19, 2024

The Problem

Given the following Github Actions YAML Workflow

---
name: Sync - ACLs

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - '*'

jobs:
  sync-acls:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Test ACLs
        uses: tailscale/gitops-acl-action@v1
        with:
          api-key: ${{ secrets.TS_API_KEY }}
          tailnet: ${{ secrets.TS_TAILNET }}
          policy-file: "policy.hujson"
          action: test

I'm getting the following warning message during the Github Actions run output

Run tailscale/gitops-acl-action@v1
Run actions/setup-go@v4.0.0
Setup go version spec 1.21.6
[...]
Warning: Restore cache failed: Dependencies file is not found in /home/runner/work/tailscale-acls/tailscale-acls. Supported file pattern: go.sum

The Explanation

It looks like because there isn't a go.sum file, the default behavior for actions/setup-go@v4.0.0 is to use caching.

From https://github.com/actions/setup-go/tree/v4.0.0?tab=readme-ov-file#v4

The V4 edition of the action offers:

  • Enabled caching by default

The action will try to enable caching unless the cache input is explicitly set to false.

The Fix

As discussed in actions/setup-go#427 (comment), the following change can be made to actions/setup-go@v4.0.0 so that the warning message goes away

- name: Setup go
  uses: actions/setup-go@v4.0.0
  with:
    cache: false
@esolitos
Copy link

I'd say this was fixed by #37

@irbekrm
Copy link
Contributor

irbekrm commented Jun 14, 2024

As @esolitos noted, the issue should be fixed by #37

We've just cut a v1.3.0 release that has this change https://github.com/tailscale/gitops-acl-action/releases/tag/v1.3.0
Let us know if you see any further issues.

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

No branches or pull requests

3 participants