Actions: Detect code changes (#107326)
This commit is contained in:
@@ -14,10 +14,29 @@ concurrency:
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
detect-changes:
|
||||
name: Detect whether code changed
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
changed: ${{ steps.detect-changes.outputs.backend }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: true # required to get more history in the changed-files action
|
||||
fetch-depth: 2
|
||||
- name: Detect changes
|
||||
id: detect-changes
|
||||
uses: ./.github/actions/change-detection
|
||||
with:
|
||||
self: .github/workflows/backend-unit-tests.yml
|
||||
|
||||
grafana:
|
||||
# Run this workflow only for PRs from forks
|
||||
# the `pr-backend-unit-tests-enterprise` workflow will run instead
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true
|
||||
needs: detect-changes
|
||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true && needs.detect-changes.outputs.changed == 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
shard: [
|
||||
@@ -53,8 +72,8 @@ jobs:
|
||||
|
||||
grafana-enterprise:
|
||||
# Run this workflow for non-PR events (like pushes to `main` or `release-*`) OR for internal PRs (PRs not from forks)
|
||||
# If it gets merged into `main` or `release-*`, then a junit test result is uploaded to GCS.
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
|
||||
needs: detect-changes
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false && needs.detect-changes.outputs.changed == 'true'
|
||||
strategy:
|
||||
matrix:
|
||||
shard: [
|
||||
|
||||
Reference in New Issue
Block a user