clean should respect the target-path
- Dominant language
- TypeScript
- Stars
- 338
- Forks
- 234
- Avg merge
- 53m
- Merged PRs (30d)
- 3
Description
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:
```yaml
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!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.