mirror of
https://github.com/tormachris/cf-workers-status-page.git
synced 2024-11-23 22:45:43 +01:00
fix(actions): let deployment pass on missing slack webhook
This commit is contained in:
parent
0145fce7c4
commit
b308d19b2c
1
.github/workflows/deploy.yml
vendored
1
.github/workflows/deploy.yml
vendored
@ -27,6 +27,7 @@ jobs:
|
|||||||
kv_namespace_id=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq ".[0].id")
|
kv_namespace_id=$(wrangler kv:namespace list | jq -c 'map(select(.title | contains("KV_STATUS_PAGE")))' | jq ".[0].id")
|
||||||
echo "[env.production]" >> wrangler.toml
|
echo "[env.production]" >> wrangler.toml
|
||||||
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=${kv_namespace_id}}]" >> wrangler.toml
|
echo "kv_namespaces = [{binding=\"KV_STATUS_PAGE\", id=${kv_namespace_id}}]" >> wrangler.toml
|
||||||
|
[ -z "$SECRET_SLACK_WEBHOOK_URL" ] && echo "Secret SECRET_SLACK_WEBHOOK_URL not set, creating dummy one..." && SECRET_SLACK_WEBHOOK_URL="default-gh-action-secret" || true
|
||||||
secrets: |
|
secrets: |
|
||||||
SECRET_SLACK_WEBHOOK_URL
|
SECRET_SLACK_WEBHOOK_URL
|
||||||
environment: production
|
environment: production
|
||||||
|
@ -42,7 +42,7 @@ export async function processCronTrigger(event) {
|
|||||||
console.log('Saving changed state..')
|
console.log('Saving changed state..')
|
||||||
|
|
||||||
// first try to notify Slack in case fetch() or other limit is reached
|
// first try to notify Slack in case fetch() or other limit is reached
|
||||||
if (typeof SECRET_SLACK_WEBHOOK_URL !== 'undefined') {
|
if (typeof SECRET_SLACK_WEBHOOK_URL !== 'undefined' && SECRET_SLACK_WEBHOOK_URL !== 'default-gh-action-secret') {
|
||||||
await notifySlack(monitor, newMetadata)
|
await notifySlack(monitor, newMetadata)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user