Github操作:如何为服务器作业创建多行环境变量
我想在代码文件中添加几行代码。这在各种工作中都有体现。所以我创建了一个作业,创建一个文本文件并上传它Github操作:如何为服务器作业创建多行环境变量,github,continuous-integration,yaml,github-actions,Github,Continuous Integration,Yaml,Github Actions,我想在代码文件中添加几行代码。这在各种工作中都有体现。所以我创建了一个作业,创建一个文本文件并上传它 create_file: runs-on: ubuntu-latest steps: - shell: bash run: | cat << EOF > data.txt A = "..." B = "..." C = "..
create_file:
runs-on: ubuntu-latest
steps:
- shell: bash
run: |
cat << EOF > data.txt
A = "..."
B = "..."
C = "..."
...
EOF
- name: Create data file
uses: actions/upload-artifact@1
with:
name: configuration
path: data.txt
我的问题是,第二个作业速度太快,在上传data.txt
文件之前搜索该文件,以及如何处理添加内容。每行的命令echo“…”>>main.py
都会非常烦人
更新:
现在我得到了作业data.txt
的以下错误消息:
Download action repository 'actions/upload-artifact@1'
##[warning]Failed to download action 'https://api.github.com/repos/actions/upload-artifact/tarball/1'. Error Response status code does not indicate success: 404 (Not Found).
...
##[error]Response status code does not indicate success: 404 (Not Found).
这个错误很愚蠢。行
操作/上传-artifact@1
应该是操作/上传-artifact@v1
所以希望两个作业并行执行,但第二个作业在第一个作业之后完成?否则,您可以将需要创建\u文件
添加到测试\u文件
作业中。看:你解决了吗?@МаааПааааааааааа107。使用带有tr
的壳管<代码>echo${{secrets.DATA}}|tr''\n'
Download action repository 'actions/upload-artifact@1'
##[warning]Failed to download action 'https://api.github.com/repos/actions/upload-artifact/tarball/1'. Error Response status code does not indicate success: 404 (Not Found).
...
##[error]Response status code does not indicate success: 404 (Not Found).