GitHub action to simply cat a file to an output

泄露秘密 提交于 2020-12-12 14:55:50

问题


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?


回答1:


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 }}


来源:https://stackoverflow.com/questions/60679609/github-action-to-simply-cat-a-file-to-an-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!