Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message when forgetting the secret #40

Closed
tr7zw opened this issue Oct 31, 2022 · 3 comments
Closed

Confusing error message when forgetting the secret #40

tr7zw opened this issue Oct 31, 2022 · 3 comments

Comments

@tr7zw
Copy link

tr7zw commented Oct 31, 2022

Ran into the error Warning: 馃椏 You didn't specify any targets, your assets have not been published with the exact same setup that worked on another project. In the middle of writing a big Discussions Q/A post, I remembered that I forgot to set up the secrets for this repo. The build should just fail in case you have a modrinth-id/curseforge-id defined, but the corresponding token is empty/invalid(since it clearly was forgotten).

@tr7zw tr7zw changed the title Confusing error message when forgettin the secret Confusing error message when forgetting the secret Oct 31, 2022
@Kir-Antipov
Copy link
Owner

Didn't think anyone will ever get this warning, and this is definitely not the case when it should be shown. Yup, will rework some things for such scenarios

@Kir-Antipov
Copy link
Owner

The build should just fail in case you have a modrinth-id/curseforge-id defined, but the corresponding token is empty/invalid(since it clearly was forgotten)

I ultimately chose not to implement this. The reason being, it's unclear when IDs are specified and when they are not. For instance, all my personal configs look like this:

- name: Upload assets to GitHub, Modrinth, and CurseForge
  uses: Kir-Antipov/mc-publish@v3.2
  with:
    name: ""
    modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
    curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
    github-token: ${{ secrets.GITHUB_TOKEN }}

Does this mean I don't want to publish my mod to Modrinth, CurseForge, or GitHub because I didn't specify IDs for Modrinth and CurseForge and a tag for GitHub? No, of course not. Those can be found in my fabric.mod.json.

Conversely, does it mean that someone who didn't specify a token for, let's say, Modrinth, but has the ID of their Modrinth project somewhere in their mod metadata for unspecified reasons, wants to publish the mod to Modrinth? Well, no, that's not always true either.

Consequently, this isn't a reliable indicator of the user's intentions. The only accurate one is a specified or unspecified token. As a result, I've simply revised the warning message that caused confusion. It now reads:

Warning: No valid platform tokens found in your config. To publish your project, please add the required access tokens for the desired platforms. Assets will not be published without them. Refer to the documentation for assistance in setting up your tokens.

I hope this provides more clarity.

@Kir-Antipov
Copy link
Owner

Implemented in v3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants