GitHub Action: zip error: Nothing to do! (try: zip -r ./bundle.zip . -i ./.)

GitHub Action: zip error: Nothing to do! (try: zip -r ./bundle.zip . -i ./.)

我有一个这样的项目目录:

└── lambda
    └── lambda_handler.py

使用以下 .yml 文件

# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: zip
        uses: montudor/action-zip@v0.1.0
        with:
          args: "zip -r ./bundle.zip ./."
      - name: default deploy
        uses: appleboy/lambda-action@master
        with:
          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws_region: eu-west-3
          function_name: generate_crawler_threads_from_processes    
          zip_file: bundle.zip

我不断收到以下错误:

zip error: Nothing to do! (try: zip -qq -r bundle.zip . -i lambda/)

无论我如何尝试执行压缩步骤,都没有用。

这是我尝试过的 zip 命令用法的其他变体列表:

zip -r bundle.zip ./*
zip -r ./bundle.zip ./*
zip -r bundle.zip .
zip -r ./bundle.zip .
zip -r bundle.zip /
zip -r bundle.zip ./
zip -r ./bundle.zip .
zip -r bundle.zip *
zip -qq -r bundle.zip .
zip -qq -r bundle.zip . -i .
zip -qq -r bundle.zip . -i lambda/

还有更多。只是它会继续抛出相同的错误。

使用前根据montudor/action-zip usage section, it seems you need to add the actions/checkout访问版本库文件和目录。

像这样:

    steps:
      - uses: actions/checkout@v2
      - name: zip
        uses: montudor/action-zip@v0.1.0
        with:
          args: "zip -r ./bundle.zip ./."
      - uses: actions/upload-artifact@v2
        with:
          name: bundle.zip