mirror of
https://github.com/himanshu8443/providers.git
synced 2026-04-18 05:51:45 +00:00
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: Check Provider URLs
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * *' # Run daily at midnight UTC
|
|
workflow_dispatch: # Allow manual triggering
|
|
|
|
# Set explicit permissions for the GITHUB_TOKEN
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
check-urls:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Install dependencies
|
|
run: npm install axios
|
|
|
|
- name: Run URL checker
|
|
run: node .github/scripts/url-checker.js
|
|
|
|
# Better approach using git status
|
|
- name: Commit changes if any
|
|
run: |
|
|
git config --global user.name "GitHub Actions"
|
|
git config --global user.email "actions@github.com"
|
|
git add modflix.json
|
|
|
|
# Check if there are changes using git status (more reliable)
|
|
if [[ $(git status --porcelain modflix.json) ]]; then
|
|
echo "Found changes in modflix.json, committing..."
|
|
git commit -m "Update provider URLs [skip ci]"
|
|
git push
|
|
else
|
|
echo "No changes detected in modflix.json"
|
|
fi
|