Remove PR creation: Commit and push directly to main

This commit is contained in:
2025-11-20 01:49:20 +01:00
parent 12626949fe
commit 2bc3dd2ee9

View File

@@ -78,37 +78,12 @@ jobs:
git status
fi
- name: Create branch and commit changes
id: create_branch
- name: Commit and push changes
if: steps.check_changes.outputs.changed == 'true'
run: |
BRANCH_NAME="update-laws-$(date +'%Y%m%d-%H%M%S')"
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
git checkout -b $BRANCH_NAME
git commit -m "Update laws from RSS - $(date +'%Y-%m-%d %H:%M:%S UTC')" || exit 0
# Push with timeout (10 minutes max) and progress output
timeout 600 git push --progress origin $BRANCH_NAME 2>&1 || echo "Push fehlgeschlagen oder Timeout"
- name: Create Pull Request
if: steps.check_changes.outputs.changed == 'true'
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
BRANCH_NAME="${{ steps.create_branch.outputs.branch_name }}"
REPO="${{ github.repository }}"
GITEA_INSTANCE="https://git.coded.law"
# Erstelle Pull Request via Gitea API
curl -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"title\": \"Update laws from RSS - $(date +'%Y-%m-%d')\",
\"head\": \"$BRANCH_NAME\",
\"base\": \"main\",
\"body\": \"Automatische Gesetzes-Updates vom RSS-Feed.\\n\\nBitte überprüfe die Änderungen vor dem Merge.\"
}" \
"$GITEA_INSTANCE/api/v1/repos/$REPO/pulls" || echo "PR-Erstellung fehlgeschlagen"
timeout 600 git push --progress origin main 2>&1 || echo "Push fehlgeschlagen oder Timeout"
- name: Summary
if: always()
@@ -116,8 +91,7 @@ jobs:
echo "## Update-Zusammenfassung"
echo "- Workflow ausgeführt: $(date)"
if [ "${{ steps.check_changes.outputs.changed }}" == "true" ]; then
echo "- OK: Änderungen wurden in Branch ${{ steps.create_branch.outputs.branch_name }} committed"
echo "- OK: Pull Request wurde erstellt"
echo "- OK: Änderungen wurden committed und auf main gepusht"
else
echo "- Info: Keine Änderungen gefunden"
fi