name: build-scripts-updated

on:
  workflow_dispatch:
  push:
    branches:
      - main
    paths:
      - "build/**"
      - ".github/workflows/build-scripts-updated.yml"
      - ".github/workflows/build-sealos-cluster-image.yml"
      - "!**/*.md"

concurrency:
  group: build-scripts-updated-${{ github.ref }}
  cancel-in-progress: true

jobs:
  trigger-workflow-build-cluster-image:
    runs-on: ubuntu-latest
    steps:
      - name: trigger cluster image workflow
        uses: peter-evans/repository-dispatch@v2
        with:
          event-type: build-scripts-updated
          client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "version": "latest"}'
