-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Action can not report test results due to 'Bad Credentials' #37
Comments
@buehlerjochen which token do you use with the action? Sadly I have no access to a GH Enterprise instance (assuming it's self hosted?), so I can't tell for sure if those require a different API / different endpoint for publishing results. All the below information is in regards to github.com. The issue with the original legacy ticket was the following setup:
GitHub actions won't provide the tokens to the PR from the fork repo (default config) to prevent leaks. E.g. to prevent evil parties who may did a fork to steal the token by modifying the github actions script. There are some settings which would for example tokens to be provided to PRs from forks: As an alternative creating a PAT (personal access token) could circumstance this too, giving the action the rights to comment on the PR/repo. Please note that those limitations ore requirements are not specific to this actions but are generally true as its high risk for PRs from forks to potentially inject code into your run actions to steal secrets. |
Thank you for the quick and detailed response. I have been trying to use
I was able to run a successful test with the labeler action, which added a label to the PR and another test where the Github API is used to create a new ticket from a workflow. Both worked with the provided token so the write access seems to be OK:
To be honest I also tested other actions to "publish" test results, but I liked your plugin's features best, especially reporting the results as PR check. Do you have any other ideas what could be causing the issue? Any "special" APIs you are calling or maybe an connection that does not use the dynamic repo URL but maybe is hardcoded to github.com? |
@buehlerjochen thank you so much for the further details on your setup. I'll look into the labeler actions source and try to see if I can identify a different usage of the API. It's much more complicated to debug such things without having the direct possibility to test in a similar infrastructure. I'll keep you updated on the findings |
…s support - FIX #37 - write error log in case no token is provided - recompile dist files with latest updates, and code change
@buehlerjochen would you please be so kind to retest with the v2.2.0 release |
@mikepenz Thank you for the fast update. I tested it on our server and it looks like it got a few steps further than before. At least it is showing the icons in the log now and before there was only the error message. |
@buehlerjochen not sure if it is the best idea to push that upstream, but I think I have a good solution to offer for you. I have pushed the preview label to this branch: https://github.com/mikepenz/action-junit-report/tree/feature/37_2 So you should be able if the way the flag is provided works by doing:
Please let me know if that works for you |
Thank you so much for trying it. that's awesome news! I would assume they are slower because it will do the API requests now successfully to apply the check, vs before them getting instantly declined. You may want to consider the following. Especially as it sounds you plan to use this in an enterprise environment, it is a great common pattern to include github actions with full length sha hashes so you can 100% ensure the state of the action you execute is exactly what you verified to be without any malicious intend. While it's very unlikely that you will run into this issue, but if you use the label like More details on this here: https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions Independent of this I will probably think a bit more on including the preview flag in, not sure if this could un-intentionally enable other features which other parties may not like to have. |
Thank you very much for your great help and the quick fix! :) |
Thank YOU so much for taking the time to work on getting this resolved. ;) |
Hi,
we would like to use your action in our GH Enterprise instance. Unfortunately, we get errors for the action:
I am aware of this discussion in the archived repo: mikepenz/action-junit-report-legacy#32
Do we have the same issue here with a read-only token because we are building a PR? Using
pull_request_target
is not very attractive to us...How is the action then intended to be used? I have to admit, that I am a bit confused. 🤔
How do I have to set up the repo and permission that it would work?
Thank you for your help and the action. :)
The text was updated successfully, but these errors were encountered: