Chore: Skip more GHA jobs if backend files are not changed (#109803)

This commit is contained in:
Tom Ratcliffe
2025-08-18 17:42:02 +01:00
committed by GitHub
parent 8283ba94fe
commit d542f6bcda
3 changed files with 63 additions and 5 deletions
+23 -4
View File
@@ -14,12 +14,31 @@ on:
- 'docs/**'
- 'latest.json'
permissions:
contents: read
id-token: write
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-code-checks.yml
validate-configs:
permissions:
contents: read
id-token: write
needs: detect-changes
if: needs.detect-changes.outputs.changed == 'true'
name: Validate Backend Configs
runs-on: ubuntu-latest
steps:
+20
View File
@@ -13,7 +13,27 @@ permissions:
contents: read
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/go-lint.yml
lint-go:
needs: detect-changes
if: needs.detect-changes.outputs.changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+20 -1
View File
@@ -14,10 +14,29 @@ concurrency:
cancel-in-progress: true
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/swagger-gen.yml
verify:
name: Verify committed API specs match
runs-on: ubuntu-latest
if: ${{ github.repository == 'grafana/grafana' }}
needs: detect-changes
if: github.repository == 'grafana/grafana' && needs.detect-changes.outputs.changed == 'true'
permissions:
contents: read # clone the repository
id-token: write # required for Vault access