github - 如何在 GitHub 操作 YML 文件中添加评论?
问题描述
在以下语法中:
jobs:
testing:
name: some test
runs-on: [ self-hosted, linux, xyz ]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.0
id: go
- name: Configure git client
run: git config --global url."ssh://git@github.com:".insteadOf "https://github.com/"
如何添加run git client to fix some issue
作为运行命令的注释?
解决方案
tl; 博士
- 利用
: #
- run: git config --global url."ssh://git@github.com:".insteadOf "https://github.com/" # run git client to fix some issue
+ run: |
+ : # run git client to fix some issue
+ git config --global url."ssh://git@github.com:".insteadOf "https://github.com/"
ts; 博士
我一直在搜索官方 GitHub 文档并四处搜索,但找不到任何工作示例。
我通过使用:
刚刚返回的操作数true
后跟#
这样的评论得出了答案:
jobs:
testing:
name: some test
runs-on: [ self-hosted, linux, xyz ]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.0
id: go
- name: Configure git client
run: |
: # run git client to fix some issue
git config --global url."ssh://git@github.com:".insteadOf "https://github.com/"
推荐阅读
- r - 使日期从 r 中的同一天开始
- visual-studio - ASP .NET Core Web 服务器控制台输出在 VS for .NET Core 2.2 中不可见
- arrays - 在 MATLAB 中使用下标的困难/混乱
- android - 从 LiveData 中获取一个值
- reactjs - 如何使用 Semantic-UI-React 在标题中呈现背景图像
- vue.js - VueJS - v-html 属性的使用不起作用
- javascript - 带有引导程序 4 模式的 Jquery Datatable 问题
- python - 我正在尝试替换此函数中的列表,而无需再次重写整个函数
- macos - 当我是 root 时,如何获取登录用户的用户名或主目录?
- sed - sed:如何在非空行上添加到行首