From 4d8ad5779b97790b7be29f47111333703efcf9c4 Mon Sep 17 00:00:00 2001 From: Vezpi Date: Mon, 23 Jun 2025 13:32:36 +0000 Subject: [PATCH] fix: disable notification when locked --- .gitea/workflows/deployment.yml | 50 ++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 03d52fc..1061936 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -217,29 +217,33 @@ jobs: steps: - name: Notify Workflow Result run: | - if [[ - "${{ needs.Check-Rebuild.result }}" == "success" && - ("${{ needs.Build.result }}" == "success" || "${{ needs.Build.result }}" == "skipped") && - "${{ needs.Deploy-Staging.result }}" == "success" && - "${{ needs.Test-Staging.result }}" == "success" && - "${{ needs.Merge.result }}" == "success" && - "${{ needs.Deploy-Production.result }}" == "success" && - "${{ needs.Test-Production.result }}" == "success" && - ("${{ needs.Clean.result }}" == "success" || "${{ needs.Clean.result }}" == "skipped") - ]]; then - curl -H "Priority: min" \ - -H "Tags: white_check_mark" \ - -d "Blog workflow completed successfully." \ - -u ${NTFY_TOKEN} \ - ${NTFY_URL}/${NTFY_TOPIC} - else - curl -H "Priority: high" \ - -H "Tags: x" \ - -H "Actions: view, View Run, ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}, clear=true; \ - view, Verify Blog, https://blog.vezpi.com, clear=true" \ - -d "Blog workflow failed!" \ - -u ${NTFY_TOKEN} \ - ${NTFY_URL}/${NTFY_TOPIC} + if [[ ${{ needs.Check-Rebuild.outputs.dev_lock_present}}" == 'false' ]]; then + if [[ + "${{ needs.Check-Rebuild.result }}" == "success" && + ("${{ needs.Build.result }}" == "success" || "${{ needs.Build.result }}" == "skipped") && + "${{ needs.Deploy-Staging.result }}" == "success" && + "${{ needs.Test-Staging.result }}" == "success" && + "${{ needs.Merge.result }}" == "success" && + "${{ needs.Deploy-Production.result }}" == "success" && + "${{ needs.Test-Production.result }}" == "success" && + ("${{ needs.Clean.result }}" == "success" || "${{ needs.Clean.result }}" == "skipped") + ]]; then + curl -H "Priority: min" \ + -H "Tags: white_check_mark" \ + -d "Blog workflow completed successfully." \ + -u ${NTFY_TOKEN} \ + ${NTFY_URL}/${NTFY_TOPIC} + else + curl -H "Priority: high" \ + -H "Tags: x" \ + -H "Actions: view, View Run, ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}, clear=true; \ + view, Verify Blog, https://blog.vezpi.com, clear=true" \ + -d "Blog workflow failed!" \ + -u ${NTFY_TOKEN} \ + ${NTFY_URL}/${NTFY_TOPIC} + else + echo "🔒 Merge is locked via .dev-lock file, no notification" + fi fi \ No newline at end of file