Skip to content

🐧🧹 Repo Linter πŸ–³πŸ—‘οΈ #1289

🐧🧹 Repo Linter πŸ–³πŸ—‘οΈ

🐧🧹 Repo Linter πŸ–³πŸ—‘οΈ #1289

Workflow file for this run

name: 🐧🧹 Repo Linter πŸ–³πŸ—‘οΈ
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
#push:
workflow_dispatch:
schedule:
- cron: "0 */6 * * *" #every 06 hrs
push:
branches:
- main
paths:
- '**'
#------------------------------------------------------------------------------------#
jobs:
check:
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
fetch-depth: "1"
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: Sanity Check PKG List
run: |
#Presets
set +x ; set +e
#--------------#
#sed '/:/!s/^/#/' -i "${GITHUB_WORKSPACE}/main/PKG_LIST.txt"
sed '/:/!s/^[^#]/#&/' -i "${GITHUB_WORKSPACE}/main/PKG_LIST.txt"
sed -E 's/^[[:space:]]+|[[:space:]]+$//g' -i "${GITHUB_WORKSPACE}/main/PKG_LIST.txt"
sort -u "${GITHUB_WORKSPACE}/main/PKG_LIST.txt" -o "${GITHUB_WORKSPACE}/main/PKG_LIST.txt"
sed -E 's/^[[:space:]]+|[[:space:]]+$//g' -i "${GITHUB_WORKSPACE}/main/PKG_LIST.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@v6
with:
repository: ./main
commit_user_name: Azathothas
commit_user_email: [email protected]
#commit_message: "β€Žβ€Žβ€β€β€Ž β€Ž"
commit_message: "βœ… Linted (Repo) πŸ›οΈ"
#push_options: '--force'
continue-on-error: true