gitops-acl-action icon indicating copy to clipboard operation
gitops-acl-action copied to clipboard

Restore cache failed: Dependencies file is not found

Open jason-riddle opened this issue 1 year ago • 2 comments

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/[email protected]
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/[email protected] 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 https://github.com/actions/setup-go/issues/427#issuecomment-1731969319, the following change can be made to actions/[email protected] so that the warning message goes away

- name: Setup go
  uses: actions/[email protected]
  with:
    cache: false

jason-riddle avatar Feb 19 '24 17:02 jason-riddle

I'd say this was fixed by https://github.com/tailscale/gitops-acl-action/pull/37

esolitos avatar Apr 22 '24 07:04 esolitos

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.

irbekrm avatar Jun 14 '24 18:06 irbekrm