🔎 Scrape Public Issues (Static Binaries) 🕸️ #7
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
#https://github.com/pkgforge/soarpkgs/blob/main/soarpkgs/scripts/scrape_pub_issues_binaries.sh | |
name: 🔎 Scrape Public Issues (Static Binaries) 🕸️ | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
schedule: | |
- cron: "30 0 * * *" #12:30 AM UTC --> 06:15 AM NPT | |
jobs: | |
IssuesScraper: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- 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 | |
##User-Agent | |
USER_AGENT="$(curl -qfsSL 'https://pub.ajam.dev/repos/Azathothas/Wordlists/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}" | |
echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}" | |
##Tools | |
#PARALLEL="1" bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh") | |
continue-on-error: true | |
- name: Scrape | |
env: | |
#GITHUB_TOKEN: "${{ github.token }}" | |
GITHUB_TOKEN: "${{ secrets.RO_GHTOKEN }}" | |
run: | | |
##presets | |
set +x ; set +e | |
#-------------# | |
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/metadata/refs/heads/main/soarpkgs/scripts/scrape_pub_issues_binaries.sh") | |
dos2unix --quiet "${GITHUB_WORKSPACE}/main/soarpkgs/scripts/scrape_pub_issues_binaries.sh" | |
chmod +x "${GITHUB_WORKSPACE}/main/soarpkgs/scripts/scrape_pub_issues_binaries.sh" | |
bash "${GITHUB_WORKSPACE}/main/soarpkgs/scripts/scrape_pub_issues_binaries.sh" | |
wc -l "${GITHUB_WORKSPACE}/main/soarpkgs/data/pub_issues_binaries.txt" | |
continue-on-error: true | |
- name: Notify (Discord) | |
run: | | |
##presets | |
set +x ; set +e | |
#-------------# | |
pushd "$(mktemp -d)" >/dev/null 2>&1 | |
#Get Config | |
sudo curl -qfsSL "https://bin.pkgforge.dev/$(uname -m)/notify" -o "/usr/local/bin/notify" && sudo chmod +x "/usr/local/bin/notify" | |
echo 'discord:' > "./notify.yaml" | |
echo ' - id: "portable-apps"' >> "./notify.yaml" | |
echo ' discord_channel: "portable-apps"' >> "./notify.yaml" | |
echo ' discord_username: "pkgforge-bot"' >> "./notify.yaml" | |
echo ' discord_format: "{{data}}"' >> "./notify.yaml" | |
echo " discord_webhook_url: \"${{ secrets.PORTABLE_APPS_NOTIFY }}\"" >> "./notify.yaml" | |
#Prep Body | |
echo 'ℹ️ **Static Binaries** [Scraped Public Github Issues] (Daily) ==> https://github.com/pkgforge/metadata/blob/main/soarpkgs/data/pub_issues_binaries.txt' > "/tmp/PKGFORGE_DISCORD.md" | |
grep -E "$(date --utc +%Y-%m-%d)T|$(date --utc --date='yesterday' +%Y-%m-%d)T" "${GITHUB_WORKSPACE}/main/soarpkgs/data/pub_issues_binaries.txt" >> "/tmp/PKGFORGE_DISCORD.md" | |
cat "/tmp/PKGFORGE_DISCORD.md" | notify -provider-config "./notify.yaml" -bulk -disable-update-check | |
popd >/dev/null 2>&1 | |
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}" | |
#Sync | |
cd "${GITHUB_WORKSPACE}/main" | |
git pull origin main --no-edit 2>/dev/null | |
#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: "✅ Scraped Public GH Issues (Static Binaries) 🕸️" | |
#push_options: '--force' | |
continue-on-error: true |