Skip to content

🐧🧹 HealthChecks 🖳🗑️ #732

🐧🧹 HealthChecks 🖳🗑️

🐧🧹 HealthChecks 🖳🗑️ #732

name: 🐧🧹 HealthChecks 🖳🗑️
#MAX_RUNTIME: 02 Minutes
on:
#push:
workflow_dispatch:
schedule:
# - cron: "45 03 * * *" # 03:45 AM UTC --> 09:30 AM Morning NPT
- cron: "0 */2 * * *" # Every 22 Hrs
jobs:
#------------------------------------------------------------------------------------#
check-post:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Debloat Runner
run: |
#Presets
set +x ; set +e
#--------------#
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Github/Runners/debloat_ubuntu.sh")
continue-on-error: true
- name: Checkout repository
uses: actions/checkout@v4
with:
path: main
filter: "blob:none"
- name: Setup Env
run: |
##presets
set +x ; set +e
#-------------#
##CoreUtils
sudo apt update -y
sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y
sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null
#temp
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}"
echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}"
continue-on-error: true
- name: Install Addons
run: |
#presets
set +x ; set +e
#-------------#
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Linux/install_bins_curl.sh")
continue-on-error: true
- name: Dos2Unix Everything
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main"
find . -type f ! -path "./.git/*" -exec dos2unix {} \; 2>/dev/null
continue-on-error: true
- name: ActionLint
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main"
find ".github/workflows" -type f -name "*ml" -exec actionlint {} \;
continue-on-error: true
- name: Shellcheck
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main"
find ".github" -type f -name '*.sh' -exec shellcheck --exclude="SC2261" --severity=error "{}" \; 2>/dev/null | tee "${GITHUB_WORKSPACE}/main/.github/shellcheck.txt"
continue-on-error: true
- name: Generate Repo Metadata (git-sizer)
run: |
#Presets
set +x ; set +e
#--------------#
cd "${GITHUB_WORKSPACE}/main"
#Dust sizes
echo '```mathematica' > "${GITHUB_WORKSPACE}/main/.github/SIZE.md"
dust -b -c -i -r -n 99999999 "${GITHUB_WORKSPACE}/main" | tee -a "${GITHUB_WORKSPACE}/main/.github/SIZE.md"
dust -b -c -i -r -n 99999999 "${GITHUB_WORKSPACE}/main" | tee "${GITHUB_WORKSPACE}/main/.github/SIZE.txt"
echo '```' >> "${GITHUB_WORKSPACE}/main/.github/SIZE.md"
continue-on-error: true
- name: Get DateTime & Purge files (=> 95 MB)
run: |
#Presets
set +x ; set +e
#--------------#
UTC_TIME="$(TZ='UTC' date +'%Y-%m-%d (%I:%M:%S %p)')"
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
#Purge
find "${GITHUB_WORKSPACE}/main" -path "${GITHUB_WORKSPACE}/main/.git" -prune -o -type f -size +95M -exec rm -rvf "{}" + 2>/dev/null
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: ./main
commit_user_name: Azathothas
commit_user_email: [email protected]
commit_message: "‎‎‏‏‎ ‎"
#commit_message: "✅ Updated (Metadata) 🛍️ <-- ${{ env.UTC_TIME }} ⌚"
#push_options: '--force'
continue-on-error: true
- name: Common Utils
env:
GITHUB_TOKEN: "${{ github.token }}"
run: |
#Presets
set +x ; set +e
#--------------#
mkdir -pv "/tmp/COMMON"
eget "https://github.com/Morganamilo/paru" --asset "aarch64" --file "paru" --to "/tmp/COMMON/paru-aarch64"
eget "https://github.com/Morganamilo/paru" --asset "x86_64" --file "paru" --to "/tmp/COMMON/paru-x86_64"
eget "https://github.com/Jguer/yay" --asset "aarch64" --file "yay" --to "/tmp/COMMON/yay-aarch64"
eget "https://github.com/Jguer/yay" --asset "x86_64" --file "yay" --to "/tmp/COMMON/yay-x86_64"
eget "https://github.com/VHSgunzo/runimage-fake-sudo-pkexec" --asset "any" --asset "tar.zst" --download-only --to "/tmp/COMMON/fake-sudo-pkexec.tar.zst"
if [[ -s "/tmp/COMMON/fake-sudo-pkexec.tar.zst" ]] && \
[[ -s "/tmp/COMMON/paru-aarch64" ]] && \
[[ -s "/tmp/COMMON/paru-x86_64" ]] && \
[[ -s "/tmp/COMMON/yay-aarch64" ]] && \
[[ -s "/tmp/COMMON/yay-x86_64" ]]; then
export HAS_COMMON="TRUE"
echo "HAS_COMMON=${HAS_COMMON}" >> "${GITHUB_ENV}"
UTC_TIME="$(TZ='UTC' date +'%Y_%m_%d')"
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
else
export HAS_COMMON="FALSE"
echo "HAS_COMMON=${HAS_COMMON}" >> "${GITHUB_ENV}"
fi
continue-on-error: true
#continuous
- name: Releaser (Continuous)
if: env.HAS_COMMON == 'TRUE'
uses: softprops/[email protected]
with:
name: "Common Utils"
tag_name: "common-utils"
prerelease: true
draft: false
generate_release_notes: false
files: |
/tmp/COMMON/*
continue-on-error: true