Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

[Bug]: 60fps.live

[Bug]: 60fps.live #8

Workflow file for this run

name: Request Issue Solver
on:
issues:
types:
- labeled
jobs:
scan_domains_request:
if: github.event.label.name == 'bug-solve'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Close Issue
uses: peter-evans/close-issue@v3
with:
issue-number: ${{ github.event.issue.number }}
comment: Terima kasih atas kontribusi Anda, permintaan penambahan domain Anda akan segera diterapkan.
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl unzip wget jq
curl -LO https://github.com/findomain/findomain/releases/latest/download/findomain-linux.zip
unzip findomain-linux.zip
chmod +x findomain
sudo mv findomain /usr/bin/findomain
wget https://raw.githubusercontent.com/bebasid/bebasid/master/dev/scripts/scan.py
echo "INSTALLATION DONE - ALL SET"
- name: Run Findomain
run: |
domain=$(jq -r '.issue.body' "$GITHUB_EVENT_PATH" | sed -n '3p' | tr -d '[:space:]')
findomain -t "$domain" -u hasilunsorted
- name: Sort Subdomains
run: |
python3 - <<EOF
with open('hasilunsorted', 'r') as file:
lines = sorted(file.readlines(), key=len)
with open('hasilsorted', 'w') as file:
file.writelines(lines)
EOF
- name: Extract Domain to Fix
id: extract_domain
run: |
domain_to_fix=$(jq -r '.issue.body' "$GITHUB_EVENT_PATH" | sed -n '3p' | tr -d '[:space:]')
echo "::set-output name=domain_to_fix::$domain_to_fix"
- name: Update Hosts File
run: |
domain_to_fix="${{ steps.extract_domain.outputs.domain_to_fix }}"
python3 - <<EOF
import re
domain = "$domain_to_fix"
start_pattern = fr"^\[{domain}\]$"
end_pattern = r"^\[.*?\]$"
with open("hosts", "r") as file:
lines = file.readlines()
start_index = None
end_index = None
for i, line in enumerate(lines):
if re.match(start_pattern, line):
start_index = i
elif start_index is not None and re.match(end_pattern, line):
end_index = i
break
if start_index is not None:
if end_index is None:
end_index = len(lines)
new_lines = lines[:start_index + 1] + open("hasilsorted", "r").readlines() + lines[end_index:]
with open("hosts", "w") as file:
file.writelines(new_lines)
print("Result Lists:")
with open("hosts", "r") as file:
print(file.read())
EOF
- name: Clean up temporary files
run: |
rm findomain-linux.zip hasilunsorted hasilsorted scan.py
- name: Commit changes
env:
issue_number: ${{ github.event.issue.number }}
issue_user: ${{ github.event.issue.user.login }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "zksbot"
git add hosts
domain=$(jq -r '.issue.body' "$GITHUB_EVENT_PATH" | sed -n '3p' | tr -d '[:space:]')
git commit -m "Fix $domain in hosts (Issue #$issue_number requested by @$issue_user)"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.UPDATE_TOKEN }}