Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Github操作:如何为服务器作业创建多行环境变量_Github_Continuous Integration_Yaml_Github Actions - Fatal编程技术网

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).