Open edgarrmondragon opened 1 month ago
I can probably take some time to submit a PR in the coming days, would that be of interest to you @humitos?
I think we should add a new attribute called "versioning-scheme" (which is what the APIv3 uses https://docs.readthedocs.io/en/stable/api/v3.html#project-details) and base the URL on that.
Also, now that APIv3 is open and un-authed, we could propbably only ask the user for the slug
and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.
Also, now that APIv3 is open and un-authed, we could propbably only ask the user for the
slug
and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.
I see, that makes sense. Seems like with the response from https://readthedocs.org/api/v3/projects/<slug>/
we could get rid of 2 settings
single-version
-> versioning_scheme
project-language
-> language.code
Also, now that https://github.com/readthedocs/readthedocs.org/pull/11485, we could propbably only ask the user for the slug and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.
We shouldn't rely on this API for all projects, on .com projects are private, and we can't hit the API directly for those without auth.
Also, now that readthedocs/readthedocs.org#11485, we could propbably only ask the user for the slug and get all the required information from the API endpoint instead. So, we may need to re-think this action a little more in depth.
We shouldn't rely on this API for all projects, on .com projects are private, and we can't hit the API directly for those without auth.
Gotcha. It's probably better then to deprecate single-version
in favor of versioning-scheme
, for example.
Currently only two schemes are supported by this action:
https://github.com/readthedocs/actions/blob/43ac444506db41f07391f7c9e82c0e71943f0ea5/preview/scripts/edit-description.js#L20-L24
Which correspond to "Single version without translations (
/<filename>
)" and "Multiple versions with translations (/<language>/<version>/<filename>
)" respectively.Fix might be adding a new option (e.g.
no-translations
) or a special valuenone
for project-language
, and use that in a condition to build the right URL.