mirror of
https://github.com/go-gitea/gitea
synced 2025-07-27 20:58:36 +00:00
Use file filters action instead of Github's files filter (#24877)
Inspired by https://github.com/go-gitea/gitea/pull/24530#issuecomment-1558815301 This PR use a file filter action to do different CI jobs according changed files types. All types are defined in `.github/file-filters.yml`. Now there are 4 types, `docs`, `backend`, `frontend` and `build`. Then if a PR only changed docs files, those CI jobs which passed the conditions will run, and other types are also like this. --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
32
.github/workflows/files-changed.yml
vendored
Normal file
32
.github/workflows/files-changed.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: files changed
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
docs:
|
||||
description: "whether docs files changed"
|
||||
value: ${{ jobs.files-changed.outputs.docs }}
|
||||
backend:
|
||||
description: "whether backend files changed"
|
||||
value: ${{ jobs.files-changed.outputs.backend }}
|
||||
frontend:
|
||||
description: "whether frontend files changed"
|
||||
value: ${{ jobs.files-changed.outputs.frontend }}
|
||||
|
||||
jobs:
|
||||
files-changed:
|
||||
name: detect which files changed
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 3
|
||||
# Map a step output to a job output
|
||||
outputs:
|
||||
docs: ${{ steps.changes.outputs.docs }}
|
||||
backend: ${{ steps.changes.outputs.backend }}
|
||||
frontend: ${{ steps.changes.outputs.frontend }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check for backend file changes
|
||||
uses: dorny/paths-filter@v2
|
||||
id: changes
|
||||
with:
|
||||
filters: .github/file-filters.yml
|
Reference in New Issue
Block a user