In a GitHub action, I'd like to remove the old bundle files from the FTP server after deploying the new bundle. To achieve this, I thought to
- Deploy new bundle
- Parse the hashes of (
main-\*.js
,polyfills-\*.js
etc) - Remove all matching files except the ones with the new hash
For (3), I intended using lftp with mrm main-*.!(328276e83108ad3616fd).js
. Yet, this does not seem to match the expected pattern by lftp. Shopts exglob is activated in the parent shell, yet I fear this has no impact on lftp.
Any hints on how to achieve above goal are highly appreciated. Thanks!
You need to enable extended globbing for it work https://www.linuxjournal.com/content/bash-extended-globbing
The problem is that this github action doesn't enable it in the alpine docker file so you will need to write your own to do as such
The easiest way to figure this out for you is to fork the repo and create a PR to support it into the StephanThierry/ftp-delete-action repo, and in the mean time use the forked repo in your pipeline
Once you fork repo then edit this file https://github.com/StephanThierry/ftp-delete-action/blob/master/Dockerfile
Then create a new version of the branch after you merge that into your fork and use that new branch as the action in your workflow