Uses: newbinary confusion

If I want a new binary in the context of my Github workflow, I think I need something like:

  • uses: actions/setup-node@v1

I.e. setup an environment. So in my case, I don’t need Node, but I do need a redo implementation, which is not in ubuntu-latest.

So I tried to create an action here: actions/goredo at main · kaihendry/actions · GitHub

Which basically sets up the binary. Now I want to use it on my checked out source:

The build failure makes me think that it’s trying to build within the context of Docker image which isn’t quite what I want: Need a ref Expected format {org}/{repo}[/path]@ref ... trying since I · kaihendry/prazefarm@97718d7 · GitHub

I want it to be able to access the shell and binaries of ubuntu-latest… so how do I achieve that?

Perhaps I shouldn’t be using a Dockerfile to install a binary? What should be my approach to install a binary I need in my build process?

Thank you in advance

Are you doing anything special with the Dockerfile that means this action specifically needs to be inside a container? Or are you just trying to set up some software for use inside your workflow?

If it’s the latter then you can probably skip using a Docker container altogether and just directly install the software inside a step of your workflow.

Or, if you’d prefer to keep this in external action for use in multiple workflows (meaning less copypasting), you could package the install steps as a composite run steps action.

Yes Thomas! I’m “just trying to set up some software for use inside your workflow”

So for example actions/setup-node@v1 is a composite run? This would explain my confusion!

Though don’t people use Docker images for effectively packaging as I am attempting to do here: actions/Dockerfile at 5c5ea22f7e4ca6e9c0aa96db986a6464c847e973 · kaihendry/actions · GitHub

The actions/setup-node action is actually written in Typescript as a Javascript action (another of the 3 types). You can see the source for it here if you want to take a look. You could also choose to write your action in JS/TS if you wanted to, though I figured as you’re just installing something using apt JS would be overkill in this situation.

They do, but Docker is also containerised. This means that anything that happens inside the container won’t affect what’s running outside, so your software won’t be installed on the host runner. If you really would like to use Docker then you would need to pass your files into the docker container action as an input and do your work inside it directly.

As you’re just installing software I’d recommend you just create a composite run step instead so your software is then available on the host runner for later steps in your workflow.

3 types, so shell “composite run”, Docker and JS “composite run”? I must say the source of actions/setup-node@v1 is pretty frightening. 10+k SLOC setup-node/index.js at c46424eee26de4078d34105d3de3cc4992202b1e · actions/setup-node · GitHub … WTH!

Is there a good example you can point to where files are passed in and out of a Docker image incidentally?