Files aren't mounted in github actions container step

Viewed 75

I have a job in which I create a file. Then I have a step in which I want to use that file, but the step is a container step. No matter what variations I try I simply cannot get the file mounted into the container.

jobs:
  flux-job:
    name: flux-job
    runs-on: self-hosted
    steps:
      - name: create file
        shell: bash
        run: echo "foo" > ${{ github.workspace }}/foo.txt
      - name: flux container
        uses: docker://ghcr.io/fluxcd/flux-cli:v0.29.4
        with:
          entrypoint: cat
          args: ${{ github.workspace }}/foo.txt

This returns a No such file or directory error.

How do I achieve the task of creating a file in one step, and using that same file in the next step, given that the next step is run in a container?

Note: the container step lacks a cli tool that I have in the previous step. I don't want to go through all the hassle of creating a new image, maintaining that image, uploading it to my image repo, authenticating with that repo, just to use the dang flux-cli.

0 Answers
Related