github动作 - 表达式中的回声

发布于 2025-02-09 05:18:21 字数 1187 浏览 0 评论 0原文

  changes:
    name: Detect changes
    runs-on: ubuntu-latest
    outputs:
      aws: ${{ steps.filter.outputs.aws }}
      azure: ${{ steps.filter.outputs.azure }}
      gcp: ${{ steps.filter.outputs.gcp }}
    steps:
    - name: Checkout source code
      uses: actions/checkout@v2
    - name: Check for changes
      uses: dorny/paths-filter@v2
      id: filter
      with:
        filters: |
          aws:
            - added|modified: 'aws/**'
          azure:
            - added|modified: 'azure/**'
          gcp:
            - added|modified: 'gcp/**'


  zip_files:
    runs-on: ubuntu-latest
    needs: changes
    steps:
      - uses: actions/checkout@v2
      - uses: montudor/action-zip@v1
        with:
          args: zip -qq -r result.zip "$(${{needs.changes.outputs.aws}} && echo aws)" "$(${{needs.changes.outputs.azure}} && echo azure)" "$(${{needs.changes.outputs.gcp}} && echo gcp)"
      - uses: actions/upload-artifact@v1
        with:
          name: my-artifact
          path: ${{ github.workspace }}/result.zip

我想打开检测更改的目录。然后将其上传到工件。

拉链时,即使AWS/Azure/GCP都评估为true,我也会收到“ zip错误:无需执行”。我认为错误在于Args线内。

  changes:
    name: Detect changes
    runs-on: ubuntu-latest
    outputs:
      aws: ${{ steps.filter.outputs.aws }}
      azure: ${{ steps.filter.outputs.azure }}
      gcp: ${{ steps.filter.outputs.gcp }}
    steps:
    - name: Checkout source code
      uses: actions/checkout@v2
    - name: Check for changes
      uses: dorny/paths-filter@v2
      id: filter
      with:
        filters: |
          aws:
            - added|modified: 'aws/**'
          azure:
            - added|modified: 'azure/**'
          gcp:
            - added|modified: 'gcp/**'


  zip_files:
    runs-on: ubuntu-latest
    needs: changes
    steps:
      - uses: actions/checkout@v2
      - uses: montudor/action-zip@v1
        with:
          args: zip -qq -r result.zip "$(${{needs.changes.outputs.aws}} && echo aws)" "$(${{needs.changes.outputs.azure}} && echo azure)" "$(${{needs.changes.outputs.gcp}} && echo gcp)"
      - uses: actions/upload-artifact@v1
        with:
          name: my-artifact
          path: ${{ github.workspace }}/result.zip

I want to zip directories that detect changes. and then upload it to artifact.

When zipping, I get a "zip error: Nothing to do" even though aws/azure/gcp all evaluate to true. I think that the error lies within the args line.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文