what the meaning of the character '|' after 'run: ' in the yml file of github action?

Viewed 452

what the meaning of the character '|' after 'run: ' in the yml file of github action? i need to understand that.thanks here is code seg:

  • name: npm install run: | npm install env: CI: true

    # 运行脚本
    - name: 运行脚本
      run: |
        COOKIE='${{ secrets.COOKIE }}' DINGTALK_WEBHOOK='${{ secrets.DINGTALK_WEBHOOK }}' DINGTALK_SECRET='${{ secrets.DINGTALK_SECRET }}' ALL_IN='${{ secrets.ALL_IN }}' WX_COMPANY_ID='${{ secrets.WX_COMPANY_ID }}' WX_APP_ID='${{ secrets.WX_APP_ID }}' WX_APP_SECRET='${{ secrets.WX_APP_SECRET }}' FEISHU_WEBHOOK='${{ secrets.FEISHU_WEBHOOK }}' FEISHU_SECRET='${{ secrets.FEISHU_SECRET }}' npm start
      env:
        CI: true
    
1 Answers

According to the documentation :

Values can span multiple lines using | or >. Spanning multiple lines using a “Literal Block Scalar” | will include the newlines and any trailing spaces. Using a “Folded Block Scalar” > will fold newlines to spaces; it’s used to make what would otherwise be a very long line easier to read and edit. In either case the indentation will be ignored

Related