Add cache rootfs creation cleanup for old files to Github Actions (#2947)

This commit is contained in:
Igor Pečovnik 2021-07-01 16:23:39 +02:00 committed by GitHub
parent a3c7334dad
commit 9d1ed95d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,7 @@ jobs:
gpg-private-key: ${{ secrets.GPG_KEY1 }}
passphrase: ${{ secrets.GPG_PASSPHRASE1 }}
- name: Sign commit and push changes
- name: Cleanup and sign rootfs cache
if: ${{ success() }}
env:
@ -131,6 +131,13 @@ jobs:
sudo apt-get -y -qq install parallel
cd build/cache/rootfs
sudo chown -R $USER:$USER .
# cleanup
for line in $(ls | cut -d. -f1-4 | sort -u); do
if [[ ! -f $line ]]; then
[[ -n "$line" ]] && rm -f "$line"*
fi
done
# sign
(for file in $(ls | cut -d. -f1-4 | sort -u); do
if [ $(ls $file* | wc -l) -lt 3 ]; then
echo "$file"