Files
providers/.github/workflows/check-urls.yml
2025-04-18 19:35:10 +05:30

49 lines
1.4 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
with:
token: ${{ secrets.PAT }} # Use PAT for checkout
- 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
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add modflix.json
# Only commit and push if there are changes
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Update provider URLs [skip ci]"
# Configure Git to use the PAT for push
git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }}.git
git push
fi