Remove PR creation: Commit and push directly to main
This commit is contained in:
@@ -78,37 +78,12 @@ jobs:
|
|||||||
git status
|
git status
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Create branch and commit changes
|
- name: Commit and push changes
|
||||||
id: create_branch
|
|
||||||
if: steps.check_changes.outputs.changed == 'true'
|
if: steps.check_changes.outputs.changed == 'true'
|
||||||
run: |
|
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
|
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
|
# Push with timeout (10 minutes max) and progress output
|
||||||
timeout 600 git push --progress origin $BRANCH_NAME 2>&1 || echo "Push fehlgeschlagen oder Timeout"
|
timeout 600 git push --progress origin main 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"
|
|
||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
if: always()
|
if: always()
|
||||||
@@ -116,8 +91,7 @@ jobs:
|
|||||||
echo "## Update-Zusammenfassung"
|
echo "## Update-Zusammenfassung"
|
||||||
echo "- Workflow ausgeführt: $(date)"
|
echo "- Workflow ausgeführt: $(date)"
|
||||||
if [ "${{ steps.check_changes.outputs.changed }}" == "true" ]; then
|
if [ "${{ steps.check_changes.outputs.changed }}" == "true" ]; then
|
||||||
echo "- OK: Änderungen wurden in Branch ${{ steps.create_branch.outputs.branch_name }} committed"
|
echo "- OK: Änderungen wurden committed und auf main gepusht"
|
||||||
echo "- OK: Pull Request wurde erstellt"
|
|
||||||
else
|
else
|
||||||
echo "- Info: Keine Änderungen gefunden"
|
echo "- Info: Keine Änderungen gefunden"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user