mirror of
https://github.com/himanshu8443/providers.git
synced 2026-04-17 21:41:45 +00:00
Update check-urls.yml
This commit is contained in:
26
.github/workflows/check-urls.yml
vendored
26
.github/workflows/check-urls.yml
vendored
@@ -5,7 +5,6 @@ on:
|
|||||||
- cron: '0 0 * * *' # Run daily at midnight UTC
|
- cron: '0 0 * * *' # Run daily at midnight UTC
|
||||||
workflow_dispatch: # Allow manual triggering
|
workflow_dispatch: # Allow manual triggering
|
||||||
|
|
||||||
# Set explicit permissions for the GITHUB_TOKEN
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
@@ -17,7 +16,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }} # Use PAT for checkout
|
token: ${{ secrets.PAT }}
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
@@ -30,19 +29,12 @@ jobs:
|
|||||||
- name: Run URL checker
|
- name: Run URL checker
|
||||||
run: node .github/scripts/url-checker.js
|
run: node .github/scripts/url-checker.js
|
||||||
|
|
||||||
|
# Use a dedicated GitHub Action for commits and pushes
|
||||||
- name: Commit and push changes
|
- name: Commit and push changes
|
||||||
run: |
|
uses: EndBug/add-and-commit@v9
|
||||||
git config --global user.name 'github-actions[bot]'
|
with:
|
||||||
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
add: 'modflix.json'
|
||||||
git add modflix.json
|
message: 'Update provider URLs [skip ci]'
|
||||||
|
default_author: github_actions
|
||||||
# Only commit and push if there are changes
|
push: true
|
||||||
if git diff --cached --quiet; then
|
github_token: ${{ secrets.PAT }}
|
||||||
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user