Closed mvcmania closed 1 year ago
analyzeModifiedFilesOnly : false
I think the message "Error: Not Found" is the response from github API when determining the latest PMD version.
The action tries to request https://api.github.com/repos/pmd/pmd/releases/latest - which seems to have failed.
We definitely can improve the error message here...
Does this problem persist? Maybe it was just a temporary problem....
Hey @adangel thanks for quick response, unfortunately it seems like a persistent but what you have said triggered a point, so im running the github action on enterprise instance where we have self-hosted runners , im suspecting , maybe the endpoint that you mentioned is not reachable under the self-hosted runner. Sounds quite unlikely but , it might be the root cause.
Hi @adangel I could curl the url https://api.github.com/repos/pmd/pmd/releases/latest from our self hosted runner. But we get that Not Found error persistently.
Hm... I'm having a suspicion, what's happening here: We use the "hydrated" github client from the actions-toolkit. "hydrated" means, it uses not necessarily api.github.com as baseurl, but your GHES url - and on your github enterprise server, there is no pmd/pmd repository.
I think, we use this url: https://github.com/actions/toolkit/blob/457303960f03375db6f033e214b9f90d79c3fe5c/packages/github/src/internal/utils.ts#L23-L25
In case of GHES, the environment variable GITHUB_API_URL
will be set and we don't query api.github.com anymore....
Hi @adangel , latest update :) We have mirrored pmd/pmd repo along with releases and tags into our GHES and we were able to pass ther "Error : NOT found" problem, we ended up another problem though which completely different. Im posting here in case you might need to fix the problem
By the way, i have already tried the fix that you have just created, it is working like a charm. Thank you. All errors are gone!
It seems, the downloaded releases zip file is corrupt. You can try to download manually the URL, that is printed in the debug output (##[debug]Downloading https....
) and verify e.g. with zipinfo
that this is indeed a PMD releases archive.
You can also compare this file with the one on https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.55.0/pmd-bin-6.55.0.zip
The sha256sum of that file should be 1acf96d43cb40d591cacccc1c20a66fc796eaddf69ea61812594447bac7a11d pmd-bin-6.55.0.zip
.
Maybe something went wrong when mirroring pmd/pmd?
Anyway, my PR #175 will use api.github.com to access the latest release. If you want, you can try out the fix:
- uses: adangel/pmd-github-action@issue-173
By the way, i have already tried the fix that you have just created, it is working like a charm. Thank you. All errors are gone!
Thanks for testing! :+1:
I have seen the similar problem that was already raised but quite unsure if those are identical so that is why i wanted to report it. Im receiving the error below.
And here is the my action YML. Please advise.