Skip to content

clean should respect the target-path #489

@thurfir

Description

@thurfir

Hi team,

I’m using the azure/webapps-deploy@v3 GitHub Action to deploy an Azure Webjob, and I’ve encountered an unexpected behavior with the clean option:

Problem

When setting:

    with:
      app-name: 'MyApp'
      package: '.'
      clean: true
      target-path: 'app_data/jobs/continuous/MyJob'

I expected the action to clean only the contents of the app_data/jobs/continuous/MyJob folder on the App Service, per the target-path. However, it appears that everything in the App Service root directory is being deleted, not just within the MyJob subdirectory.

Expected Behavior

When target-path is specified and clean: true is enabled, only the contents of the specified target-path should be cleared—not the entire web app root.

Actual Behavior

The clean operation deletes all files and folders at the root level of the App Service, even if target-path is set to a subfolder. This causes unintended data loss in scenarios where multiple folders (eg: multiple WebJobs) coexist in the web root.

Suggested Fix

The clean operation should respect the target-path and only remove contents within that subdirectory. Alternatively, this behavior should be clearly documented if it's by design (though it seems counterintuitive).

Let me know if I can provide additional logs or testing. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions