2

I want to implement my own Docker GitHub Action that should provide an executable called my-tool which I can use in my workflows. Ideally, I want to be able to write the following config in my workflow:

- name: Setup My Tool
  uses: actions/my-tool@v1
  
- name: Run My Tool
  run: my-tool --option1 --option2 arg1 arg2

My custom action that provides my-tool is responsible for creating the my-tool executable (either by downloading it or building from sources). And I want my action to make this executable available within the rest of my workflow. However, I can't find any way to copy my executable from the docker container back to host that runs my action. How can I transfer my-tool from the Docker GitHub Action to my workflow?

Shersh
  • 9,019
  • 3
  • 33
  • 61
  • I'd recommend taking a look at other installer actions and check how they do it. For instance: https://github.com/Azure/setup-kubectl – Max Jul 13 '20 at 19:26
  • 1
    @Max thanks for your reply! Unfortunately, all other installing actions are written in TypeScript. GitHub actions allow two ways to implement custom actions: Docker and TypeScript. I was hoping that I can simply run a Docker container, do a couple of steps in there and then just copy produced binary back to host. – Shersh Jul 14 '20 at 17:28
  • There is no way inside a docker container to copy back to the host. GitHub Actions does mount the workspace which is shared across all actions so you could copy your tool there and then exec it with `./my-tool` – Chris Patterson Sep 01 '20 at 14:44

0 Answers0