Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
    
like image 937
zadaji Avatar asked Nov 30 '25 06:11

zadaji


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

like image 63
Tom Avatar answered Dec 02 '25 04:12

Tom