forked from botpress/botpress
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.94 KB
/
check-integration-versions.yml
File metadata and controls
64 lines (54 loc) · 1.94 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
name: Check Integration Versions
on: pull_request
permissions:
id-token: write
contents: read
jobs:
check-integration-versions:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Setup
uses: ./.github/actions/setup
- name: Login to Botpress
env:
TOKEN: ${{ secrets.PRODUCTION_TOKEN_CLOUD_OPS_ACCOUNT }}
WORKSPACE_ID: ${{ secrets.PRODUCTION_CLOUD_OPS_WORKSPACE_ID }}
run: pnpm bp login -y --token "$TOKEN" --workspace-id "$WORKSPACE_ID"
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: 'integrations/**/*.{ts,md,svg}'
separator: '\n'
- name: Check integration versions
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
modified_integrations=$(echo -e "$CHANGED_FILES" | awk -F'/' '{print $2}' | sort -u)
should_fail=0
SKIP_INTEGRATIONS=("chat")
for integration in $modified_integrations; do
skip=0
for skip_integration in "${SKIP_INTEGRATIONS[@]}"; do
if [ "$integration" = "$skip_integration" ]; then
echo "Skipping $integration"
skip=1
break
fi
done
if [ $skip -eq 1 ]; then
continue
fi
echo "Checking $integration"
exists=$(./.github/scripts/integration-exists.sh "$integration")
if [ "$exists" -ne 0 ]; then
echo "Integration $integration is already deployed publicly with the same version. Please update the version of your integration."
should_fail=1
fi
done
if [ "$should_fail" -ne 0 ]; then
echo "Please update the version of your integration before pushing your changes."
exit 1
fi