Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create main.yml #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Test the project and update the test-date

on:
schedule:
- cron: '0 */12 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repo'
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: 'Generate key and update the test time'
run: |
ACCOUNT=0
KEY=1
SMALL_BUSINESS_KEY=1
EMAIL_API=mailticking
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git clone --depth 1 https://github.com/rzc0d3r/ESET-KeyGen.git
cd ESET-KeyGen
# Setup env
sudo apt update
sudo apt install -y python3-pip python3-venv
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
echo "Test results:" >> $GITHUB_STEP_SUMMARY
if [[ ${ACCOUNT} != 0 ]]
then
for ((attempt=1;attempt<=${ACCOUNT};++attempt))
do
python3 main.py --chrome --account --email-api ${EMAIL_API} --skip-update-check --no-logo --disable-progress-bar
done
echo -e "\nAccounts generated:" >> $GITHUB_STEP_SUMMARY
cat ./*ACCOUNTS.txt >> $GITHUB_STEP_SUMMARY
fi
if [[ ${KEY} != 0 && ${SMALL_BUSINESS_KEY} != 0 ]]
then
if [[ ${KEY} != 0 ]]
then
for ((attempt=1;attempt<=${KEY};++attempt))
do
python3 main.py --chrome --key --email-api ${EMAIL_API} --skip-update-check --no-logo --disable-progress-bar
done
fi
if [[ ${SMALL_BUSINESS_KEY} != 0 ]]
then
for ((attempt=1;attempt<=${SMALL_BUSINESS_KEY};++attempt))
do
python3 main.py --chrome --small-business-key --email-api ${EMAIL_API} --skip-update-check --no-logo --disable-progress-bar
done
fi
echo -e "\nKeys generated:" >> $GITHUB_STEP_SUMMARY
cat ./*KEYS.txt >> $GITHUB_STEP_SUMMARY
fi
echo
cd ${{ github.workspace }}
sed -i '/^ESET-KeyGen - Trial-Key & Account generator/ c\ESET-KeyGen - Trial-Key & Account generator for ESET Antivirus (last test was on '"$(date -u --date='3 hours' +"%d.%m.%Y at %H:%M UTC+3")"')' README.md
sudo rm -r ESET-KeyGen
git pull
git commit -m "Update test time" -a
- name: Push changes to the repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT }}
branch: ${{ github.ref }}