-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modrinth throws Authentication error #49
Comments
The description of this error may suggest that there is an issue on our side (i.e., we did not specify some mysterious To avoid having your tokens expire randomly, you can generate your own token with custom options in the "Personal Access Tokens" tab of your GitHub personal settings. Note, that only the permission to "Read all user profile data" is required by Modrinth. DO NOT grant tokens without an expiration date permissions to access your repositories, packages, or any other important things associated with your account. However, it's not a bad idea for tokens to periodically expire because of security reasons. So, the best practice here would be to request a new token from Modrinth once a month and update all projects that depend on it. |
Also, you could ask Modrinth devs to fix this quite confusing error description ;) I'll pin this issue for now so that other users can quickly find a solution when they inevitably encounter the same problem. |
Closing the issue, but if you have more questions (or in case the problem persists) feel free to let me know how can I help you! |
I remember saying that uploads only need Modrinth's Token to upload, didn't understand why they would return a 401 |
Which scopes does the Modrinth token require? The action run in question: https://github.com/Forsaken-Borders/Apollo/actions/runs/6600915516/job/17932871717 |
|
@Kir-Antipov thank you for the quick response. Unfortunately even after giving my Modrinth PAT the correct permissions, I'm still having the same error. I even tried modifying the PAT to have all permissions, however that didn't work either. Would you like me to create a new issue for this? |
@OoLunar, actually, wait. Are you sure that you didn't forget to set the key's value? This is your action's log, and it seems that GitHub cannot provide a token value to mc-publish because it's absent:
|
Unfortunately I still seem to be having the same issue. I'm not sure what's the problem here. Regardless, this doesn't seem like an issue with your action. Beyond a null check, I don't think there's anything you could do. Thank you very much for your quick assistance! I appreciate you making this action and I look forward to being able to use it. |
Actually, there is a null check: Lines 68 to 70 in 69d94c5
If a falsy value is provided (e.g.,
Thank you for the kind words! Sadly, I have no idea what could have gone wrong with the GitHub Runner in your case and why it refuses to provide the specified value. The only possibilities I can think of are:
|
I thought this was the case too (and prayed it wasn't), so I just copied and pasted the secret name from the screenshot above into the action. No dice.
I thought that too. "Oh maybe secrets require additional authorization like Dependabot does." This did lead me to my solution!
With and without, yep yep. That didn't make a difference either, beyond a little bit of more information. GitHub's Composite ActionsApparently, when you call workflow B from workflow A, GitHub changes a few things. As per the GitHub docs, there are a few behavioral changes made for security reasons. One of those changes is that secrets must be explicitly passed to the invoked workflow. I wish I knew this before thinking "Oh I'll just reuse my tag workflow so I don't have to have some code duplication. All I have to do was add the Fast forward and hour later and here I am asking for help on this issue. "My secrets are now undefined for whatever reason, am I using your action incorrectly?" No, not at all! I'm using MY action incorrectly because I didn't explicitly request which secrets to use! workflow_call:
secrets:
MODRINTH_TOKEN:
description: 'The token to use for Modrinth authentication'
required: true This just about drove me insane and I apologize for dragging you through with me. Hopefully my troubles assist someone else, though I prove doubtful. Thank you once more for having great patience with me, it really does mean everything to me. |
Oh, that's what happened to you! This is interesting. I completely missed the fact that you call the workflow in question from somewhere else, to be quite frankly honest with you. I'm very glad that you've figured it out! Also, thank you for the detailed, textbook-worthy explanation of your situation. I will definitely feature it on the Wiki when I'm finally done with it (god, I'm working on too much stuff right now), because this is something users should be notified about, so they won't encounter the same seemingly strange errors as you did.
No need to apologize! The action was created to simplify the publishing process, not to make it harder. So, in some way, this is my fault that I still don't have a comprehensive guide on how to set up a GitHub Workflow and avoid any GitHub quirks in the process :) And, once again, I appreciate the kind words, even though I wasn’t of much help in this situation, and you ended up finding the root of your problems yourself :) |
I had this error and resolved it by grant |
See here: https://github.com/ReviversMC/unsaddle/actions/runs/4166216846/jobs/7210263184
The text was updated successfully, but these errors were encountered: