mitchspano / sfdx-scan-pull-request

Runs sfdx-scanner on a pull request and generates in-line comments with the findings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upload step fails with 'detected dubious ownership in repository...'

codefriar opened this issue · comments

Full log:

Run mitchspano/sfdx-scan-pull-request@v0.1.7
/usr/bin/docker exec  4[7](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:8)fe6deb3c3fc61d[8](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:9)fe751548f556cea802a06fdb639e461df98c9feacc90516 sh -c "cat /etc/*release | grep ^ID"
Validating that this action was invoked from a pull request...
Getting difference within the pull request...
fatal: detected dubious ownership in repository at '/__w/salesforce/salesforce'
To add an exception for this directory, call:

	git config --global --add safe.directory /__w/salesforce/salesforce
node:internal/errors:841
  const err = new Error(message);
              ^

Error: Command failed: git remote add -f destination https://github.com/Chief-eng/salesforce.git
fatal: detected dubious ownership in repository at '/__w/salesforce/salesforce'
To add an exception for this directory, call:

	git config --global --add safe.directory /__w/salesforce/salesforce

    at checkExecSyncError (node:child_process:828:11)
    at execSync (node:child_process:8[9](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:10)9:15)
    at getDiffInPullRequest (/__w/_actions/mitchspano/sfdx-scan-pull-request/v0.1.7/index.js:96:3)
    at main (/__w/_actions/mitchspano/sfdx-scan-pull-request/v0.1.7/index.js:325:3)
    at Object.<anonymous> (/__w/_actions/mitchspano/sfdx-scan-pull-request/v0.1.7/index.js:333:1)
    at Module._compile (node:internal/modules/cjs/loader:1[10](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:11)5:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:[11](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:12)59:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:[12](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:13)) {
  status: 128,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(196) [Uint8Array] [
      102,  97, 116,  97, 108,  58,  32, 100, 101, 116, 101,  99,
      116, 101, 100,  32, 100, 117,  98, 105, 111, 117, 115,  32,
      111, 119, 110, 101, 1[14](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:15), 1[15](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:16), 104, 105, 112,  32, 105, 110,
       32, 114, 101, 112, 111, 115, 105, 1[16](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:17), 111, 114, 121,  32,
       97, 116,  32,  39,  47,  95,  95, 119,  47, 115,  97, 108,
      101, 115, 102, 111, 114,  99, 101,  47, 115,  97, 108, 101,
      115, 102, 111, 114,  99, 101,  39,  10,  84, 111,  32,  97,
      100, 100,  32,  97, 110,  32, 101, 120,  99, 101, 112, 116,
      105, 111, 110,  32,
      ... 96 more items
    ]
  ],
  pid: 266,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(196) [Uint8Array] [
    102,  97, 116,  97, 108,  58,  32, 100, 101, 116, 101,  99,
    116, 101, 100,  32, 100, 1[17](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:18),  98, 105, 111, 117, 115,  32,
    111, 1[19](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:20), 110, 101, 114, 115, 104, 105, 112,  32, 105, 110,
     32, 114, 101, 112, 111, 115, 105, 116, 111, 114, 121,  32,
     97, 116,  32,  39,  47,  95,  95, 119,  47, 115,  97, 108,
    101, 115, 102, 111, 114,  99, 101,  47, 115,  97, 108, 101,
    115, 102, 111, 114,  99, 101,  39,  10,  84, 111,  32,  97,
    100, 100,  32,  97, 110,  32, 101, 1[20](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:21),  99, 101, 112, 116,
    105, 111, 110,  [32](https://github.com/Chief-eng/salesforce/actions/runs/4611359737/jobs/8151027057#step:5:33),
    ... 96 more items
  ]
}

Closing this issue as the root cause actually has nothing todo with this excellent plugin.

If anyone else finds this issue via search, here's what happened to me.
I was using a container parameter, specifically container: salesforce/salesforcedx:latest-full and not installing the SFDX cli, as it comes with that container. For whatever reason, running this plugin inside a container fails with a dubious ownership fatal error (above). Running this without the container, on just 'ubuntu-latest' works fine.