Skip to content

Commit 3a86a9c

Browse files
authored
Create healthchecks_housekeeping.yaml
1 parent 3e643f4 commit 3a86a9c

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: 🐧🧹 HealthChecks 🖳🗑️
2+
#MAX_RUNTIME: 02 Minutes
3+
4+
on:
5+
#push:
6+
workflow_dispatch:
7+
schedule:
8+
# - cron: "45 03 * * *" # 03:45 AM UTC --> 09:30 AM Morning NPT
9+
- cron: "0 */2 * * *" # Every 22 Hrs
10+
11+
jobs:
12+
#------------------------------------------------------------------------------------#
13+
check-post:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: write
18+
19+
steps:
20+
- name: Debloat Runner
21+
run: |
22+
#Presets
23+
set +x ; set +e
24+
#--------------#
25+
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Github/Runners/debloat_ubuntu.sh")
26+
continue-on-error: true
27+
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
path: main
32+
filter: "blob:none"
33+
34+
- name: Setup Env
35+
run: |
36+
##presets
37+
set +x ; set +e
38+
#-------------#
39+
##CoreUtils
40+
sudo apt update -y
41+
sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y
42+
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
43+
#temp
44+
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}"
45+
echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}"
46+
continue-on-error: true
47+
48+
- name: Install Addons
49+
run: |
50+
#presets
51+
set +x ; set +e
52+
#-------------#
53+
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Linux/install_bins_curl.sh")
54+
continue-on-error: true
55+
56+
- name: Dos2Unix Everything
57+
run: |
58+
#Presets
59+
set +x ; set +e
60+
#--------------#
61+
cd "${GITHUB_WORKSPACE}/main"
62+
find . -type f ! -path "./.git/*" -exec dos2unix {} \; 2>/dev/null
63+
continue-on-error: true
64+
65+
- name: ActionLint
66+
run: |
67+
#Presets
68+
set +x ; set +e
69+
#--------------#
70+
cd "${GITHUB_WORKSPACE}/main"
71+
find ".github/workflows" -type f -name "*ml" -exec actionlint {} \;
72+
continue-on-error: true
73+
74+
- name: Shellcheck
75+
run: |
76+
#Presets
77+
set +x ; set +e
78+
#--------------#
79+
cd "${GITHUB_WORKSPACE}/main"
80+
find ".github" -type f -name '*.sh' -exec shellcheck --exclude="SC2261" --severity=error "{}" \; 2>/dev/null | tee "${GITHUB_WORKSPACE}/main/.github/shellcheck.txt"
81+
continue-on-error: true
82+
83+
- name: Generate Repo Metadata (git-sizer)
84+
run: |
85+
#Presets
86+
set +x ; set +e
87+
#--------------#
88+
cd "${GITHUB_WORKSPACE}/main"
89+
#Dust sizes
90+
echo '```mathematica' > "${GITHUB_WORKSPACE}/main/.github/SIZE.md"
91+
dust -b -c -i -r -n 99999999 "${GITHUB_WORKSPACE}/main" | tee -a "${GITHUB_WORKSPACE}/main/.github/SIZE.md"
92+
dust -b -c -i -r -n 99999999 "${GITHUB_WORKSPACE}/main" | tee "${GITHUB_WORKSPACE}/main/.github/SIZE.txt"
93+
echo '```' >> "${GITHUB_WORKSPACE}/main/.github/SIZE.md"
94+
continue-on-error: true
95+
96+
- name: Get DateTime & Purge files (=> 95 MB)
97+
run: |
98+
#Presets
99+
set +x ; set +e
100+
#--------------#
101+
UTC_TIME="$(TZ='UTC' date +'%Y-%m-%d (%I:%M:%S %p)')"
102+
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
103+
#Purge
104+
find "${GITHUB_WORKSPACE}/main" -path "${GITHUB_WORKSPACE}/main/.git" -prune -o -type f -size +95M -exec rm -rvf "{}" + 2>/dev/null
105+
continue-on-error: true
106+
107+
- uses: stefanzweifel/git-auto-commit-action@v5
108+
with:
109+
repository: ./main
110+
commit_user_name: Azathothas
111+
commit_user_email: [email protected]
112+
commit_message: "‎‎‏‏‎ ‎"
113+
#commit_message: "✅ Updated (Metadata) 🛍️ <-- ${{ env.UTC_TIME }} ⌚"
114+
#push_options: '--force'
115+
continue-on-error: true

0 commit comments

Comments
 (0)