【问题标题】:How to automatically select the latest tagged version of an GitHub action?如何自动选择 GitHub 操作的最新标记版本?
【发布时间】:2020-01-10 02:55:53
【问题描述】:

由于 GitHub 操作的文档远远落后,我在网上找不到任何关于它的信息。

有没有办法让 GitHub 操作选择最新的标记版本?

如果我想选择一个版本,我会这样做:

  uses: MarvinJWendt/run-node-formatter@1.2.0

如果我总是想要最新的提交,我会使用 master 分支

  uses: MarvinJWendt/run-node-formatter@master

但是,由于主分支正在开发中且不稳定,我该怎么做才能获得最新的 标记 版本?

【问题讨论】:

    标签: github github-actions


    【解决方案1】:

    如果无法运行git describe --tags(为了get the latest tag),一种解决方法是:

    • 每次应用标签时,都会将专用“tags”分支重置到该标签
    • 在您的 GitHub Action 工作流程中,您将“use”“tags”分支,根据其构造,该分支将引用最新标签。

    【讨论】:

    • 是的,这是一个很好的解决方法,但维护起来有点费力。我希望将来会推出类似@latest 的东西:)
    • @MarvinJWendt 我同意。这只是等待未来的演变。
    猜你喜欢
    • 1970-01-01
    • 2020-11-04
    • 2019-02-06
    • 2021-09-19
    • 2021-12-21
    • 2022-10-07
    • 1970-01-01
    • 2018-05-23
    • 1970-01-01
    相关资源
    最近更新 更多