Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub action to simply cat a file to an output

I want to cat the contents of my VERSION file (e.g. 0.9.0) into a variable and pass it to another GitHub action as input. However, from what I can tell, this requires creating a new GitHub action just to cat the file to an 'output' which could then be used as input to the next module.

Is there a GitHub action that already does this - or is there some simpler solution I'm missing?

like image 594
aaronsteers Avatar asked Mar 14 '20 04:03

aaronsteers


1 Answers

I don't think you need to create an action for this. cat should be usable in a run step.

Try something like this:

      - name: Get version
        id: vars
        run: echo ::set-output name=version::$(cat VERSION)
      - name: Test output
        run: echo ${{ steps.vars.outputs.version }}
like image 195
peterevans Avatar answered Sep 18 '22 16:09

peterevans