name: Update Indexers List on: workflow_dispatch: schedule: - cron: '0 0 * * *' repository_dispatch: types: [update-indexers] jobs: update-indexers: runs-on: ubuntu-latest steps: - name: Check out autobrr.com repo uses: actions/checkout@v3 with: repository: 'autobrr/autobrr.com' path: 'autobrr.com' token: ${{ secrets.DOCS_TOKEN }} - name: Check out autobrr repo uses: actions/checkout@v3 with: repository: 'autobrr/autobrr' path: 'autobrr' - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.x' - name: Update indexers list run: python3 autobrr/scripts/update-indexers.py - name: Create Pull Request run: | cd autobrr.com git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" # Create a new branch BRANCH_NAME="update-indexers-$(date +%Y%m%d-%H%M%S)" git checkout -b $BRANCH_NAME # Add and commit changes git add snippets/indexers.mdx snippets/freeleech.mdx # Only proceed if there are changes if ! git diff --quiet && ! git diff --staged --quiet; then git commit -m "docs: update indexers and freeleech support lists" git push origin $BRANCH_NAME # Create PR using GitHub CLI gh pr create \ --repo autobrr/autobrr.com \ --base main \ --head $BRANCH_NAME \ --title "docs: update indexers and freeleech support lists" \ --body "Automated update of the indexers and freeleech support lists from definitions" \ --label "documentation" fi env: GITHUB_TOKEN: ${{ secrets.DOCS_TOKEN }}