name: Detect changed files description: Detects whether any matching files have changed in the current PR inputs: self: description: The path to the calling workflow (e.g. .github/workflows/backend-unit-tests.yml). It is regarded as any category. required: true outputs: self: description: Whether the calling workflow has changed in any way value: ${{ steps.changed-files.outputs.self_any_changed || 'true' }} backend: description: Whether the backend or self have changed in any way value: ${{ steps.changed-files.outputs.backend_any_changed || 'true' }} frontend: description: Whether the frontend or self has changed in any way value: ${{ steps.changed-files.outputs.frontend_any_changed || 'true' }} frontend-packages: description: Whether any frontend packages have changed value: ${{ steps.changed-files.outputs.frontend_packages_any_changed || 'true' }} e2e: description: Whether the e2e tests or self have changed in any way value: ${{ steps.changed-files.outputs.e2e_any_changed == 'true' || steps.changed-files.outputs.backend_any_changed == 'true' || steps.changed-files.outputs.frontend_any_changed == 'true' || 'true' }} e2e-cloud-plugins: description: Whether the cloud plugins code or tests have changed in any way value: ${{ steps.changed-files.outputs.e2e_cloud_plugins_any_changed || 'true' }} dev-tooling: description: Whether the dev tooling or self have changed in any way value: ${{ steps.changed-files.outputs.dev_tooling_any_changed || 'true' }} docs: description: Whether the docs or self have changed in any way value: ${{ steps.changed-files.outputs.docs_any_changed || 'true' }} dockerfile: description: Whether the dockerfile or self have changed in any way value: ${{ steps.changed-files.outputs.dockerfile_any_changed || 'true' }} devenv: description: Whether the devenv or self have changed in any way value: ${{ steps.changed-files.outputs.devenv_any_changed || 'true' }} runs: using: composite steps: # Assumption: We've done a checkout with the actions/checkout action. # It must persist credentials to allow the changed-files action to get more history. - name: Detect changes id: changed-files if: github.event_name == 'pull_request' uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46 with: files_yaml: | self: - '.github/actions/change-detection/**' - '${{ inputs.self }}' dockerfile: - 'Dockerfile' backend: - '!*.md' - '!docs/**' - '!.github/**' - '.github/actions/setup-enterprise/**' - '.github/actions/checkout/**' - '**/go.mod' - '**/go.sum' - 'go.mod' - 'go.sum' - 'go.work' - 'go.work.sum' - '**.go' - 'pkg/**' - '!pkg/**.md' - 'apps/**' - '!apps/**.md' - 'build.sh' - '.github/actions/change-detection/**' - '**.cue' - 'devenv/docker/blocks/*_tests/**' - 'kindsv2/**' - '${{ inputs.self }}' frontend: - '.github/actions/setup-enterprise/**' - '.github/actions/checkout/**' - 'public/**' - '**.js' - '**.jsx' - '**.ts' - '**.tsx' - '**.css' - '**.mjs' - 'yarn.lock' - 'package.json' - '!**.md' - '.github/actions/change-detection/**' - '**.cue' - '.prettier*' - '.yarnrc.yml' - 'eslint.config.js' - 'jest.config.js' - 'nx.json' - 'tsconfig.json' - '.yarn/**' - 'apps/dashboard/pkg/migration/**' - '${{ inputs.self }}' frontend_packages: - '.github/actions/checkout/**' - '.github/actions/change-detection/**' - 'packages/**' - './scripts/validate-npm-packages.sh' - '${{ inputs.self }}' e2e: - 'e2e/**' - 'e2e-playwright/**' - '.github/actions/setup-enterprise/**' - '.github/actions/checkout/**' - 'emails/**' - 'pkg/**' - 'proto/**' - '**/Makefile' - 'scripts/**' - '!**.md' - '.github/actions/change-detection/**' - '**.cue' - 'conf/**' - 'cypress.config.js' - '${{ inputs.self }}' e2e_cloud_plugins: - 'pkg/tsdb/azuremonitor/**' - 'public/app/plugins/datasource/azuremonitor/**' - 'e2e-playwright/cloud-plugins-suite/azure-monitor.spec.ts' - '${{ inputs.self }}' dev_tooling: - '.github/actions/setup-enterprise/**' - '.github/actions/checkout/**' - '**.sh' - '.trivyignore' - '.prettierrc.js' - '**/Makefile' - 'proto/**.yaml' - 'pkg/build/**' - 'pkg/wire/**' - 'scripts/**' - '!**.md' - '.citools/**' - '.github/actions/change-detection/**' - '${{ inputs.self }}' docs: - 'contribute/**' - 'docs/**' - '**.md' - 'LICENSE' - '.vale.ini' - '.github/actions/change-detection/**' - '${{ inputs.self }}' devenv: - 'devenv/**' - '${{ inputs.self }}' - name: Print all change groups shell: bash run: | echo "Self: ${{ steps.changed-files.outputs.self_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.self_all_changed_files }}" echo "Backend: ${{ steps.changed-files.outputs.backend_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.backend_all_changed_files }}" echo "Frontend: ${{ steps.changed-files.outputs.frontend_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.frontend_all_changed_files }}" echo "Frontend packages: ${{ steps.changed-files.outputs.frontend_packages_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.frontend_packages_all_changed_files }}" echo "E2E: ${{ steps.changed-files.outputs.e2e_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.e2e_all_changed_files }}" echo " --> ${{ steps.changed-files.outputs.backend_all_changed_files }}" echo " --> ${{ steps.changed-files.outputs.frontend_all_changed_files }}" echo "E2E cloud plugins: ${{ steps.changed-files.outputs.e2e_cloud_plugins_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.e2e_cloud_plugins_all_changed_files }}" echo "Dev Tooling: ${{ steps.changed-files.outputs.dev_tooling_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.dev_tooling_all_changed_files }}" echo "Docs: ${{ steps.changed-files.outputs.docs_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.docs_all_changed_files }}" echo "Dockerfile: ${{ steps.changed-files.outputs.dockerfile_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.dockerfile_all_changed_files }}" echo "devenv: ${{ steps.changed-files.outputs.devenv_any_changed || 'true' }}" echo " --> ${{ steps.changed-files.outputs.devenv_all_changed_files }}"