Update Shop Status #2041
This file contains hidden or 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 Shop Status | |
on: | |
schedule: | |
- cron: '0 */1 * * *' # Every hour | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install requests beautifulsoup4 | |
- name: Run shop checker | |
run: python check_url.py | |
- name: Commit and push if changed | |
env: | |
TOKEN: ${{ secrets.PAT_OPENNX_SHOP_STATUS }} | |
run: | | |
git config user.name "GitHub Action" | |
git config user.email "action@github.com" | |
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }} | |
git add tinfoil.json | |
if git diff --cached --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -m "🔁 Update tinfoil shop status" | |
git push | |
fi |