V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
AndyAO
V2EX  ›  程序员

用命令行操作 GitHub Actions

  •  1
     
  •   AndyAO · Oct 10, 2021 · 2265 views
    This topic created in 1659 days ago, the information mentioned may be changed or developed.

    总感觉 GitHub Actions 用起来很麻烦,因为需要去网页上操作,最近发现是可以用 CLI 的,今天 4 月才有这种功能。

    https://github.blog/changelog/2021-04-15-github-cli-1-9-enables-you-to-work-with-github-actions-from-your-terminal/

    6 replies    2021-10-10 17:47:32 +08:00
    stille
        1
    stille  
       Oct 10, 2021 via iPhone
    如果是单纯触发,可以配置 on workflow_dispatch,curl api v3 来触发
    AndyAO
        2
    AndyAO  
    OP
       Oct 10, 2021
    @stille 有 GitHub 官方提供的 CLI,比自己用 curl 触发方便很多,感觉这是舍近求远
    zhaiblog
        3
    zhaiblog  
       Oct 10, 2021 via iPhone
    要是能提供调试功能就好了,不然有时候写个 workflow 要 commit 好几次去调试
    AndyAO
        4
    AndyAO  
    OP
       Oct 10, 2021
    @zhaiblog 可以直接用命令行触发,例如,gh workflow run pytest.yml ,commit 这种方式会破坏历史记录。
    stille
        5
    stille  
       Oct 10, 2021 via iPhone
    @AndyAO #2 主要有些触发可能要丢到脚本里,并不是每台服务器都装了 cli
    AndyAO
        6
    AndyAO  
    OP
       Oct 10, 2021
    @stille 懂了😯
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   844 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 21:22 · PVG 05:22 · LAX 14:22 · JFK 17:22
    ♥ Do have faith in what you're doing.