Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ runs:
shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }}
run: pnpm i --frozen-lockfile

- name: Cache Turbo
uses: actions/cache@v5
with:
path: |
.turbo
node_modules/.cache/turbo
key: turbo-${{ runner.os }}-${{ github.workflow_ref }}
restore-keys: |
turbo-${{ runner.os }}-

- name: Build
shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }}
env:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/check-plugin-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check Plugins Versions

on: pull_request

permissions:
id-token: write
contents: read

jobs:
check-plugins-versions:
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: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: 'plugins/**/*.{ts,md,svg}'
separator: '\n'
- name: Check plugin versions
run: |
modified_plugins=$(echo -e "${{ steps.changed-files.outputs.all_changed_files }}" | awk -F'/' '{print $2}' | sort -u)

should_fail=0

for plugin in $modified_plugins; do
echo "Checking $plugin"
exists=$(./.github/scripts/plugin-exists.sh $plugin)

if [ $exists -ne 0 ]; then
echo "Plugin $plugin is already deployed publicly with the same version. Please update the version of your plugin."
should_fail=1
fi
done

if [ $should_fail -ne 0 ]; then
echo "Please update the version of your plugin before pushing your changes."
exit 1
fi
Loading