forked from botpress/botpress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprod-master-version-verification.yml
More file actions
71 lines (60 loc) · 2.43 KB
/
prod-master-version-verification.yml
File metadata and controls
71 lines (60 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Production version matches master
on:
schedule:
- cron: '0 8 * * 1-5'
workflow_dispatch: # optional manual trigger
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Setup
uses: ./.github/actions/setup
- name: Login to Botpress
run: pnpm bp login -y --token ${{ secrets.PRODUCTION_TOKEN_CLOUD_OPS_ACCOUNT }} --workspace-id ${{ secrets.PRODUCTION_CLOUD_OPS_WORKSPACE_ID }}
- name: Check integration versions
run: |
SKIP_INTEGRATIONS=("docusign" "zendesk" "zendesk-messaging-hitl")
integrations=$(ls -d integrations/*/ | xargs -n1 basename | sort -u)
should_fail=0
outdated_integrations=""
skipped_integrations=""
for integration in $integrations; do
# Check if integration should be skipped
skip=0
for skip_integration in "${SKIP_INTEGRATIONS[@]}"; do
if [ "$integration" = "$skip_integration" ]; then
echo "Skipping $integration"
skip=1
skipped_integrations="$skipped_integrations$integration\n"
break
fi
done
if [ $skip -eq 1 ]; then
continue
fi
echo "Checking $integration"
exists=$(.github/scripts/integration-exists.sh $integration)
if [ $exists -eq 0 ]; then
echo "Integration $integration is not up to date. Please deploy the latest version of your integration."
should_fail=1
outdated_integrations="$outdated_integrations$integration\n"
fi
done
if [ $should_fail -eq 1 ]; then
message="\n\nThe following integrations are out of date:\n$outdated_integrations"
message="$message\nThe following integrations were skipped:\n$skipped_integrations"
message="$message\nPlease run the deployment for the out-of-date integrations."
echo "\n\nSending curl request to Slack webhook"
echo "Response:"
curl -X POST ${{ secrets.SLACK_WORKFLOW_SEAGULL_WEBHOOK_URL }} \
-H "Content-Type: application/json" \
-d '{
"key": "prod-master-version-verification",
"text": "'"$message"'"
}'
echo "\nCurl request sent"
echo "$message"
exit 1
fi