Merge branch 'main' into staging
This commit is contained in:
@@ -8,8 +8,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
merge:
|
merge:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
|
||||||
reason: ${{ steps.check.outputs.reason }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -30,15 +28,9 @@ jobs:
|
|||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
git fetch origin
|
git fetch origin
|
||||||
COUNT=$(git rev-list --count origin/staging..origin/main)
|
if [ $(git rev-list --count origin/staging..origin/main) -gt 0 ]; then
|
||||||
if [ "$COUNT" -gt 0 ]; then
|
|
||||||
echo "reason=ok" >> $GITHUB_OUTPUT
|
|
||||||
echo "❌ Staging is behind main and requires manual merging."
|
echo "❌ Staging is behind main and requires manual merging."
|
||||||
exit 1
|
exit 1
|
||||||
elif [ "$COUNT" -eq 0 ]; then
|
|
||||||
echo "reason=identical" >> $GITHUB_OUTPUT
|
|
||||||
echo "✅ Staging and main are identical. Nothing to do."
|
|
||||||
exit 42
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Create PR from staging to main
|
- name: Create PR from staging to main
|
||||||
@@ -61,7 +53,7 @@ jobs:
|
|||||||
|
|
||||||
notify_failure:
|
notify_failure:
|
||||||
needs: merge
|
needs: merge
|
||||||
if: failure() && needs.merge.outputs.reason != 'identical'
|
if: failure()
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Send Discord notification on failure
|
- name: Send Discord notification on failure
|
||||||
@@ -70,3 +62,15 @@ jobs:
|
|||||||
-X POST \
|
-X POST \
|
||||||
-d "{\"content\": \"🚨 Auto-Merge fehlgeschlagen! Bitte manuell prüfen: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}" \
|
-d "{\"content\": \"🚨 Auto-Merge fehlgeschlagen! Bitte manuell prüfen: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}" \
|
||||||
${{ secrets.DISCORD_WEBHOOK_URL }}
|
${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
|
|
||||||
|
notify_success:
|
||||||
|
needs: merge
|
||||||
|
if: success()
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Send Discord notification on success
|
||||||
|
run: |
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d "{\"content\": \"✅ Auto-Merge ausgeführt! Ergebnis jetzt auf [GitHub](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) und [online-energieausweis.org](https://online-energieausweis.org) einsehen.\"}" \
|
||||||
|
${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
Reference in New Issue
Block a user