crytic / slither-action

GNU Affero General Public License v3.0
127 stars 20 forks source link

"detected dubious ownership in repository" for a Foundry project #49

Closed CodeSandwich closed 1 year ago

CodeSandwich commented 1 year ago

My CI suddenly started failing on Slither action:

[-] Installing dependencies from foundry.toml
Error: 
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

    git config --global --add safe.directory /github/workspace

I haven't upgraded anything (except Foundry, it keeps rolling) or changed any configuration.

I've tried adding a CI step:

run: git config --global --add safe.directory /github/workspace

and adding an actions/checkout parameter:

set-safe-directory: '/github/workspace'

None of these worked, the error keeps popping up.

A failing run: https://github.com/radicle-dev/drips-contracts/actions/runs/4102797360/jobs/7076195503

CodeSandwich commented 1 year ago

A probable root cause: https://github.com/actions/runner/issues/2033

Worked it around by adding --build-info to forge test that is run before running Slither and adding with: ignore-compile: true to the Slither action configuration.

elopez commented 1 year ago

Thanks for the report @CodeSandwich! That issue you linked could be the root case indeed.

I prepared a small change in #50 that should help with this issue, could you try it out and let me know if it helps? It should be enough to specify using: crytic/slither-action@dev-git-safe-workspace on your workflow to test it.

elopez commented 1 year ago

v0.3.0 was just released and contains this fix 👍