Update README with Trending NFT Collections #4442
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: Update README with Trending NFT Collections | |
on: | |
schedule: | |
- cron: '0 * * * *' # Runs every hour | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
update-readme: | |
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 venv .venv | |
. .venv/bin/activate | |
pip install requests | |
- name: Update README | |
env: | |
OPENSEA_API_KEY: ${{ secrets.OPENSEA_API_KEY }} | |
run: | | |
. .venv/bin/activate | |
python update_art_gallery.py | |
- name: Configure Git | |
run: | | |
git config --global user.name 'pakelcomedy' | |
git config --global user.email 'danieldna1411@gmail.com' | |
- name: Check for changes | |
id: git_status | |
run: | | |
git status --porcelain | |
- name: Stash changes if needed | |
if: steps.git_status.outputs.changes != '' | |
run: | | |
git stash | |
- name: Pull latest changes | |
run: | | |
git pull origin main | |
- name: Apply stash if needed | |
if: steps.git_status.outputs.changes != '' | |
run: | | |
git stash pop | |
- name: Commit and push changes | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
git add README.md | |
git commit -m 'Latest Trending NFT Collections 🚀' || echo "No changes to commit" | |
git push origin main |