Update domains.py #5
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
name: Extract Domains | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
extract_domains: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Run extraction script | |
run: | | |
python domains.py | |
- name: Check for new changes | |
id: changes | |
run: | | |
git diff --quiet && echo 'No changes' || echo '::set-output name=changed::true' | |
- name: Commit and Push Changes | |
if: steps.changes.outputs.changed == 'true' | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add Domains/output.txt | |
timestamp=$(TZ='Asia/Tehran' date) | |
git commit -m "✅Updated on ${timestamp}" | |
git push |