ammaraskar / sphinx-action

Github action that builds docs using sphinx and places errors inline
Apache License 2.0
194 stars 116 forks source link

Potential move to @sphinx-doc #55

Open AA-Turner opened 1 year ago

AA-Turner commented 1 year ago

Hi @ammaraskar,

Would you consider moving this repo to @sphinx-doc? I'd like to provide first-party support for a GitHub Actions action, and it makes sense to build on prior art.

If not, no worries, but I thought worth asking!

Thanks, Adam

ammaraskar commented 1 year ago

Ok here's my main qualm on using this repo as a base for an official sphinx action. It uses Github docker actions and I don't think there's a way to control which docker image gets used based on the config file.

i.e we can't do something like:

    - uses: ammaraskar/sphinx-action@master
      with:
        sphinx-version: "2.4.4"

and have it use sphinxdoc/sphinx:2.4.4

but for

        sphinx-version: "2.4.5"

have it use sphinxdoc/sphinx:2.4.5

This is currently a big nuisance as many people are pinned to ammaraskar/sphinx-action@master which means I can't really change the docker image here https://github.com/ammaraskar/sphinx-action/blob/master/Dockerfile without breaking a bunch of people. But at the same time it's hard to use the action if you need a newer sphinx version.


The main advantage this action provided was that it allowed warnings/errors to be surfaced as annotations and let you to "just" specify your docs folder like this:

    - uses: ammaraskar/sphinx-action@master
      with:
        docs-folder: "docs/"

and usually have everything work out of the box.

I think we should reimplement this using a composite action which is essentially just a meta-action that lets you combine other actions and commands. See for example action-python. This composite action could set up the problem matcher, install a customizable version of sphinx and then build the docs, allowing for the ease-of-use of an action but still giving flexibility on being able to switch out the version etc.

gcattan commented 12 months ago

You could create different branches with different versions of the Dockerfile.