1
0
mirror of https://github.com/Prowlarr/Indexers.git synced 2026-04-25 10:58:28 +01:00

feat: add separate PR workflow (disabled)

This commit is contained in:
ServarrAdmin
2025-08-15 20:19:11 -05:00
committed by bakerboy448
parent 95ec7855db
commit 193d3851be
2 changed files with 110 additions and 2 deletions

109
.github/workflows/indexer-sync-pr.yml vendored Normal file
View File

@@ -0,0 +1,109 @@
---
name: Indexer Sync PR Creation
# This workflow is currently disabled
# Uncomment the 'on' section when ready to enable
# on:
# workflow_run:
# workflows: ["Indexer Sync Automation"]
# types:
# - completed
# workflow_dispatch:
# inputs:
# branch_name:
# description: 'Branch name to create PR from'
# required: true
# default: 'automated-indexer-sync'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
create-pr:
name: Create Pull Request
runs-on: ubuntu-latest
if: github.repository == 'Prowlarr/Indexers' && false # Disabled with false condition
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Check for changes on sync branch
id: check-changes
run: |
BRANCH_NAME="${{ github.event.inputs.branch_name || 'automated-indexer-sync' }}"
# Check if branch exists
if ! git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
echo "No sync branch found. Skipping PR creation."
echo "has_changes=false" >> $GITHUB_OUTPUT
exit 0
fi
# Checkout the branch and check for differences with master
git fetch origin "$BRANCH_NAME"
git checkout "$BRANCH_NAME"
if git diff --quiet origin/master...HEAD; then
echo "No changes found. Skipping PR creation."
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "Changes found. Will create/update PR."
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Create or update pull request
if: steps.check-changes.outputs.has_changes == 'true'
run: |
BRANCH_NAME="${{ github.event.inputs.branch_name || 'automated-indexer-sync' }}"
# Check if PR already exists
EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --state open --json number --jq '.[0].number' 2>/dev/null || echo "")
if [ -n "$EXISTING_PR" ]; then
echo "Updating existing PR #$EXISTING_PR"
gh pr edit "$EXISTING_PR" --body "## Automated Indexer Sync
This PR contains automated updates from the Jackett repository.
**⚠️ Backporting was skipped** - Manual review may be required for older schema versions.
### Latest Update: $(date --iso-8601=seconds)
- Triggered by: ${{ github.event_name }}
- Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Please review the changes carefully before merging."
else
echo "Creating new pull request"
gh pr create \
--title "🤖 Automated Indexer Sync ($(date +%Y-%m-%d))" \
--body "## Automated Indexer Sync
This PR contains automated updates from the Jackett repository.
**⚠️ Backporting was skipped** - Manual review may be required for older schema versions.
### Automation Details:
- Sync performed with \`-z\` flag (backports skipped)
- Triggered by: ${{ github.event_name }}
- Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Please review the changes carefully before merging." \
--head "$BRANCH_NAME" \
--base master
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Summary
if: steps.check-changes.outputs.has_changes == 'true'
run: |
echo "✅ PR creation workflow completed"
echo "📝 PR created/updated for automated indexer sync"

View File

@@ -66,5 +66,4 @@ jobs:
- name: Summary
run: |
echo "✅ Indexer sync workflow completed"
echo "📝 Changes pushed to automated-indexer-sync branch"
echo "🔗 PR creation moved to separate workflow (currently on ice)"
echo "📝 Changes pushed to automated-indexer-sync branch"