Closed dschach closed 2 years ago
Thanks for raising this issue - do you have a link that you can share to the invocation of the GitHub action?
The diffBetweenCurrentAndParentBranch.txt
is a text file which stores the difference between the branch you are trying to pull in and the branch you are trying to pull to. This .js template literal is where we concatenate the branch names into a git diff command to determine which files have changed as part of the pull request and populate that file.
execSync(
`git diff origin/${this.pullRequest?.base?.ref}...origin/${this.pullRequest?.head?.ref} > ${DIFF_OUTPUT}`
)
The fact that this evaluates to origin/undefined...origin/undefined
makes it look like this action was executed outside of the scope of a pull request - hence the failure.
That makes sense. I was running it manually.
Does this need to handle that use case?
On Wed, Nov 16, 2022, 06:03 Mitchell spano @.***> wrote:
Thanks for raising this issue - do you have a link that you can share to the invocation of the GitHub action?
The diffBetweenCurrentAndParentBranch.txt is a text file which stores the difference between the branch you are trying to pull in and the branch you are trying to pull to. This .js template https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals literal is where we concatenate the branch names into a git diff command to determine which files have changed as part of the pull request and populate that file.
execSync(
git diff origin/${this.pullRequest?.base?.ref}...origin/${this.pullRequest?.head?.ref} > ${DIFF_OUTPUT}
)source https://github.com/mitchspano/sfdx-scan-pull-request/blob/main/index.js#L79 .
The fact that this evaluates to origin/undefined...origin/undefined makes it look like this action was executed outside of the scope of a pull request - hence the failure.
— Reply to this email directly, view it on GitHub https://github.com/mitchspano/sfdx-scan-pull-request/issues/20#issuecomment-1317072896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE3QMPEIWCO5L4OWF3ZPJTWITSSNANCNFSM6AAAAAAR7KTKDE . You are receiving this because you authored the thread.Message ID: @.***>
Given that this action is called sfdx-scan-pull-request
, I don't know if it needs to be usable outside of that scope. However, I will modify the action so that there is a clear error message in this scenario.
Added an error which is thrown when the action is invoked outside the scope of a pull request.
I get the feeling that it doesn't like my PMD rules. Eslint seems to dislike them too, but this is a tool that I'd expect to get it. I don't know what the
diffBetweenCurrentAndParentBranch.txt
file is - are you able to support incremental vs full scans?Is it hurting because I have no Apex code and basically no metadata? It's a base project template so I have all the things I like set up the way I like them for new projects.
This is my workflow job:
Error message: