Skip to content

Commit a7f71ef

Browse files
authored
+
1 parent 3cc09c7 commit a7f71ef

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

.github/workflows/healthchecks_housekeeping.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ jobs:
7575
set +x ; set +e
7676
#--------------#
7777
cd "${GITHUB_WORKSPACE}/main"
78+
#--------------#
79+
##AM##
7880
#https://github.com/ivan-hc/AM/tree/main/programs
7981
AM_PKGNUM_AARCH64="$(curl -qfsSL "https://raw.githubusercontent.com/ivan-hc/AM/refs/heads/main/programs/aarch64-apps" | sort -u | wc -l | tr -d '[:space:]')"
8082
AM_PKGNUM_I686="$(curl -qfsSL "https://raw.githubusercontent.com/ivan-hc/AM/refs/heads/main/programs/i686-apps" | sort -u | wc -l | tr -d '[:space:]')"
@@ -83,25 +85,41 @@ jobs:
8385
if [ "${AM_PKGNUM}" -gt 2000 ]; then
8486
sed -E "s/(<td>)[0-9]+(<\/td>)/\1${AM_PKGNUM}\2/" -i "${GITHUB_WORKSPACE}/main/soar/readme/packages.md"
8587
fi
86-
##Provides no aarch64 bottles for Linux as of 2025-02-10
88+
#--------------#
89+
##Brew##
8790
#https://formulae.brew.sh/docs/api/
91+
#Provides no aarch64 bottles for Linux as of 2025-02-10
8892
BREW_PKGNUM="$(curl -qfsSL "https://formulae.brew.sh/api/formula.json" | jq -r '.[] | .name' | sort -u | wc -l | tr -d '[:space:]')"
8993
if [ "${BREW_PKGNUM}" -gt 7000 ]; then
9094
sed -E "s/(<td>[0-9]+<\/td><td>)[0-9]+(<\/td>)/\1${BREW_PKGNUM}\2/" -i "${GITHUB_WORKSPACE}/main/soar/readme/packages.md"
9195
fi
92-
##Offers no way to count per arch
96+
#--------------#
97+
##Pacstall##
9398
#https://github.com/pacstall/pacstall-programs/tree/master/packages
94-
PACSTALL_PKGNUM="$(curl -qfsSL "https://api.gh.pkgforge.dev/repos/pacstall/pacstall-programs/contents/packages" | jq -r '.[] | select(.type == "dir") | .name' | sort -u | wc -l | tr -d '[:space:]')"
99+
#PACSTALL_PKGNUM_TMP="$(curl -qfsSL "https://api.gh.pkgforge.dev/repos/pacstall/pacstall-programs/contents/packages" | jq -r '.[] | select(.type == "dir") | .name' | sort -u | wc -l | tr -d '[:space:]')"
100+
pushd "$(mktemp -d)" &>/dev/null && git clone --filter="blob:none" --depth="1" --no-checkout "https://github.com/pacstall/pacstall-programs" && cd "./pacstall-programs"
101+
git sparse-checkout set "" && git checkout
102+
PACSTALL_REPO_LOCAL="$(realpath .)" && export PACSTALL_REPO_LOCAL="${PACSTALL_REPO_LOCAL}"
103+
if [[ -d "${PACSTALL_REPO_LOCAL}" ]] && [[ $(du -s "${PACSTALL_REPO_LOCAL}" | cut -f1) -gt 100 ]]; then
104+
PACSTALL_PKGNUM_TMP="$(git -C "${PACSTALL_REPO_LOCAL}" ls-tree --name-only 'HEAD' -- "packages/" | xargs -I "{}" basename "{}" | sort -u | sed -E 's/^[[:space:]]+|[[:space:]]+$//g' | grep -Eiv '\.(git|md|txt)' | wc -l | tr -d '[:space:]')"
105+
fi
106+
#Offers no way to count per arch , so we multiply by 2 just in case
107+
PACSTALL_PKGNUM="$((PACSTALL_PKGNUM_TMP * 2))"
95108
if [ "${PACSTALL_PKGNUM}" -gt 600 ]; then
96109
sed -E "s/(<td>[0-9]+<\/td><td>[0-9]+<\/td><td>)[0-9]+(<\/td>)/\1${PACSTALL_PKGNUM}\2/" -i "${GITHUB_WORKSPACE}/main/soar/readme/packages.md"
97110
fi
98-
##Offers no way to count per arch
111+
#--------------#
112+
##PPKG##
113+
#Offers no way to count per arch, so we multiply by 2 just in case
99114
#https://github.com/leleliu008/ppkg-formula-repository-official-core/tree/master/formula
100-
PPKG_PKGNUM="$(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/data/PPKG.json" | jq -r '.[] | .pkg' | sort -u | wc -l | tr -d '[:space:]')"
115+
PPKG_PKGNUM_MULTI="$(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/misc/data/PPKG.json" | jq -r '.[] | .pkg' | sort -u | wc -l | tr -d '[:space:]')"
116+
PPKG_PKGNUM="$((PPKG_PKGNUM_MULTI * 2))"
101117
if [ "${PPKG_PKGNUM}" -gt 1000 ]; then
102118
sed -E "s/(<td>[0-9]+<\/td><td>[0-9]+<\/td><td>[0-9]+<\/td><td>)[0-9]+(<\/td>)/\1${PPKG_PKGNUM}\2/" -i "${GITHUB_WORKSPACE}/main/soar/readme/packages.md"
103119
fi
104-
##https://github.com/pkgforge/metadata#counts
120+
#--------------#
121+
##Soar##
122+
#https://github.com/pkgforge/metadata#counts
105123
#CACHE_PKG_NUM="$(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/soarpkgs/data/TOTAL_CACHE.txt" | tr -d '[:space:]')"
106124
##https://docs.pkgforge.dev/repositories/soarpkgs/metadata
107125
#SBUILD_PKG_NUM="$(curl -qfsSL "https://meta.pkgforge.dev/soarpkgs/INDEX.json" | jq -r '.[] | .pkg_id' | wc -l | tr -d '[:space:]')"

0 commit comments

Comments
 (0)