Removing old packages #320
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Remove old packages | |
on: | |
push: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
clean-old-packages: | |
runs-on: ubuntu-latest | |
container: fedora:39 | |
steps: | |
- name: Install dependencies | |
run: | | |
dnf install -y rpmdevtools git git-lfs | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
token: ${{ secrets.PUSH_TOKEN }} | |
- name: Clean old packages | |
run: | | |
git config --global --add safe.directory '*' | |
git config user.email "securedrop@freedom.press" | |
git config user.name "sdcibot" | |
# Preserve up to 4 packages for both nightlies and non-nightlies | |
find workstation -mindepth 1 -maxdepth 2 -type d | xargs -I '{}' ./scripts/clean-old-packages '{}' 4 | |
git add . | |
# Index will be clean if there are no changes | |
git diff-index --quiet HEAD || git commit -m "Removing old packages" | |
git push origin main |