如何在 github actions 中的其他运行命令中使用curl的响应

cma*_*ews 6 github-actions

尝试从curl 获取响应并在后续命令中使用它。不确定这里的正确语法应该是什么。

    - name: Get Token    
    run: |
      response = $(curl https://********* -header "Accept: application/json" -header "X-Username: ${{ secrets.USER_NAME }}" -header "X-Password: ${{ secrets.PASSWORD }}")         
      echo "response from curl= $response"  
Run Code Online (Sandbox Code Playgroud)

Gau*_*ane 1

尝试这样使用


  - name: Get Token    
    run: |
      response = $(curl https://********* -header "Accept= application/json" -header "X-Username= ${{ secrets.USER_NAME }}" -header "X-Password= ${{ secrets.PASSWORD }}")         
      echo "response from curl= $response"  
Run Code Online (Sandbox Code Playgroud)