fix: don't run notify job when locked
All checks were successful
Blog Deployment / Check-Rebuild (push) Successful in 6s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 9s
Blog Deployment / Test-Staging (push) Successful in 2s
Blog Deployment / Merge (push) Has been skipped
Blog Deployment / Deploy-Production (push) Has been skipped
Blog Deployment / Test-Production (push) Has been skipped
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Has been skipped
All checks were successful
Blog Deployment / Check-Rebuild (push) Successful in 6s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 9s
Blog Deployment / Test-Staging (push) Successful in 2s
Blog Deployment / Merge (push) Has been skipped
Blog Deployment / Deploy-Production (push) Has been skipped
Blog Deployment / Test-Production (push) Has been skipped
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Has been skipped
This commit is contained in:
@@ -209,7 +209,7 @@ jobs:
|
|||||||
Notify:
|
Notify:
|
||||||
needs: [Check-Rebuild, Build, Deploy-Staging, Test-Staging, Merge, Deploy-Production, Test-Production, Clean]
|
needs: [Check-Rebuild, Build, Deploy-Staging, Test-Staging, Merge, Deploy-Production, Test-Production, Clean]
|
||||||
runs-on: ubuntu
|
runs-on: ubuntu
|
||||||
if: always()
|
if: always() && needs.Check-Rebuild.outputs.dev_lock_present == 'false'
|
||||||
env:
|
env:
|
||||||
NTFY_URL: https://ntfy.vezpi.me
|
NTFY_URL: https://ntfy.vezpi.me
|
||||||
NTFY_TOPIC: blog
|
NTFY_TOPIC: blog
|
||||||
@@ -217,33 +217,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Notify Workflow Result
|
- name: Notify Workflow Result
|
||||||
run: |
|
run: |
|
||||||
if [[ ${{ needs.Check-Rebuild.outputs.dev_lock_present}}" == 'false' ]]; then
|
if [[
|
||||||
if [[
|
"${{ needs.Check-Rebuild.result }}" == "success" &&
|
||||||
"${{ needs.Check-Rebuild.result }}" == "success" &&
|
("${{ needs.Build.result }}" == "success" || "${{ needs.Build.result }}" == "skipped") &&
|
||||||
("${{ needs.Build.result }}" == "success" || "${{ needs.Build.result }}" == "skipped") &&
|
"${{ needs.Deploy-Staging.result }}" == "success" &&
|
||||||
"${{ needs.Deploy-Staging.result }}" == "success" &&
|
"${{ needs.Test-Staging.result }}" == "success" &&
|
||||||
"${{ needs.Test-Staging.result }}" == "success" &&
|
"${{ needs.Merge.result }}" == "success" &&
|
||||||
"${{ needs.Merge.result }}" == "success" &&
|
"${{ needs.Deploy-Production.result }}" == "success" &&
|
||||||
"${{ needs.Deploy-Production.result }}" == "success" &&
|
"${{ needs.Test-Production.result }}" == "success" &&
|
||||||
"${{ needs.Test-Production.result }}" == "success" &&
|
("${{ needs.Clean.result }}" == "success" || "${{ needs.Clean.result }}" == "skipped")
|
||||||
("${{ needs.Clean.result }}" == "success" || "${{ needs.Clean.result }}" == "skipped")
|
]]; then
|
||||||
]]; then
|
curl -H "Priority: min" \
|
||||||
curl -H "Priority: min" \
|
-H "Tags: white_check_mark" \
|
||||||
-H "Tags: white_check_mark" \
|
-d "Blog workflow completed successfully." \
|
||||||
-d "Blog workflow completed successfully." \
|
-u ${NTFY_TOKEN} \
|
||||||
-u ${NTFY_TOKEN} \
|
${NTFY_URL}/${NTFY_TOPIC}
|
||||||
${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}
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "🔒 Merge is locked via .dev-lock file, no notification"
|
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}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user