GitHub动作,简单地将文件分类为输出 [英] GitHub action to simply cat a file to an output

查看:54
本文介绍了GitHub动作,简单地将文件分类为输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想 cat 我的VERSION文件的内容(例如 0.9.0 )到一个变量中,并将其作为输入传递给另一个GitHub动作.但是,据我所知,这需要创建一个新的GitHub操作,只是将文件分类为输出",然后可以将其用作下一个模块的 input .

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.

是否已经有一个GitHub动作已在执行此操作-还是我缺少一些更简单的解决方案?

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

推荐答案

我认为您无需为此创建操作. cat 应该可以在 run 步骤中使用.

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

尝试这样的事情:

      - name: Get version
        id: vars
        run: echo ::set-output name=version::$(cat VERSION)
      - name: Test output
        run: echo ${{ steps.vars.outputs.version }}

这篇关于GitHub动作,简单地将文件分类为输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆