-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (78 loc) · 3.68 KB
/
scrape_issues.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#https://github.com/pkgforge/soarpkgs/blob/main/scripts/scrape_pub_issues.sh
name: 🔎 Scrape Public Issues 🕸️
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/Azathothas/Arsenal/main/misc/Linux/install_dev_tools.sh")
continue-on-error: true
- name: Scrape
run: |
##presets
set +x ; set +e
#-------------#
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/scripts/scrape_pub_issues.sh")
dos2unix --quiet "${GITHUB_WORKSPACE}/main/scripts/scrape_pub_issues.sh"
chmod +x "${GITHUB_WORKSPACE}/main/scripts/scrape_pub_issues.sh"
bash "${GITHUB_WORKSPACE}/main/scripts/scrape_pub_issues.sh"
wc -l "${GITHUB_WORKSPACE}/main/.github/pub_issues.txt"
continue-on-error: true
- name: Notify (Discord)
run: |
##presets
set +x ; set +e
#-------------#
pushd "$(mktemp -d)" >/dev/null 2>&1
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"
grep -E "$(date --utc +%Y-%m-%d)T|$(date --utc --date='yesterday' +%Y-%m-%d)T" "${GITHUB_WORKSPACE}/main/.github/pub_issues.txt" | 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
#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 🕸️"
#push_options: '--force'
continue-on-error: true