Error while using the action
devboorla opened this issue · comments
Beginning sfdx-scan-pull-request run...
Validating that this action was invoked from an acceptable context...
Getting difference within the pull request ... { baseRef: 'abc-demo-01', headRef: 'jira-001' }
error: remote destination already exists.
(node:14284) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ...
to show where the warning was created)
node:child_process:826
err = new Error(msg);
^
Error: Command failed: git remote add -f destination https://github.ABC.com/salesforce/ABC-Salesforce-POC.git
error: remote destination already exists.
Thanks for checking out the action. Please share your repository's workflow YML so I can assist with debugging.
- name: Run SFDX Scanner - Report findings as comments
uses: mitchspano/sfdx-scan-pull-request@v0.1.10
with:
pmdconfig: .github/workflows/pmd-ruleset.xml
severity-threshold: 4
strictly-enforced-rules: '[{ "engine": "pmd", "category": "Performance", "rule": "AvoidDebugStatements" }]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Can you share the entire file? I would like to see how the checkout action is being performed.
Is this being ran on a standalone repository or on a fork of an existing repository?
fork of an existing repo. Whenever a PR is created the action is being called upon. checkout and all happens properly as I am running validation against target org successfully. I unfortunately cannot share code as it is for an enterprise. but below is the action that I use to do checkout. pretty standard stuff. nothing out of ordinary.
build:
runs-on: Java
steps:
- uses: actions/checkout@v2
....
....
....
- name: Install Salesforce CLI
run: |
node_modules/sfdx-cli/bin/run plugins:install @salesforce/sfdx-scanner
Gotcha - thank your for clarifying.
The code in question is here.
It was introduced in #24 as part of a fix for #23. I am curious why that seemed to resolve the issue then, but it is causing errors now....
To test this out, I have removed the registration of the destination
remote in this commit on the fixForkingIssue branch.
Can you try again with the following yml structure:
- name: Run SFDX Scanner - Report findings as comments
uses: mitchspano/sfdx-scan-pull-request@fixForkingIssue
with:
pmdconfig: .github/workflows/pmd-ruleset.xml
severity-threshold: 4
strictly-enforced-rules: '[{ "engine": "pmd", "category": "Performance", "rule": "AvoidDebugStatements" }]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Hi! my Apologies. I was trying out something else and I was working on few other things. Incorporating the above action gives me below error:
Getting difference within the pull request ... { baseRef: 'abc-demo-01', headRef: 'jira-001' }
fatal: ambiguous argument 'destination/abc-demo-01...origin/jira-001': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
(node:11381) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ...
to show where the warning was created)
The same issue on self-hosted runner and latest version v0.1.10:
node:internal/errors:841
const err = new Error(message);
^
Error: Command failed: git remote add -f destination https://github.com/.git
fatal: remote destination already exists.
Applied a workaround with pre-step:
- name: Pre-scan step
run: git remote remove destination
The strange thing is that it worked initially without issues, then switched on ubuntu-latest for testing and once switched back to self-hosted - got this error.
It's odd that we have issues with both the main
and the firForkingIssue
branches. Those criteria are mutually exclusive - either the destination
branch is there, or it is not.
Perhaps @Yurii-Zakharov's finding about the running OS might hold some clues.
@devboorla Can you try running both branches on ubuntu and see if the issue persists?