-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 2.14 KB
/
Copy pathHandoff.yml
File metadata and controls
74 lines (69 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Handoff
on:
push:
branches:
- main
pull_request:
jobs:
handoff:
runs-on: ubuntu-latest
outputs:
category: ${{ steps.changed-file-extensions.outputs.category }}
directory: ${{ steps.changed-file-extensions.outputs.directory }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46
- name: Get directories and extensions of changed files
id: changed-file-extensions
run: |
category=
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
directory+=" $(echo $file | cut -d/ -f1)"
ext="${file##*.}"
case $ext in
go)
category+=" Go";;
ts)
category+=" TypeScript";;
yml)
category+=" Yaml";;
*)
echo "Unable to check syntax of $file.";;
esac
done
echo "category=$category" >> $GITHUB_OUTPUT
echo "directory=$directory" >> $GITHUB_OUTPUT
tui-golint:
needs: handoff
if: contains(needs.handoff.outputs.category, 'Go') && contains(needs.handoff.outputs.directory, 'tui')
uses: ./.github/workflows/Golint.yml
with:
subrepo: tui
backend-golint:
needs: handoff
if: contains(needs.handoff.outputs.category, 'Go') && contains(needs.handoff.outputs.directory, 'backend')
uses: ./.github/workflows/Golint.yml
with:
subrepo: backend
web-tsc:
needs: handoff
uses: ./.github/workflows/Tsc.yml
if: contains(needs.handoff.outputs.category, 'TypeScript') && contains(needs.handoff.outputs.directory, 'web')
with:
subrepo: web
web-eslint:
needs: handoff
uses: ./.github/workflows/Eslint.yml
if: contains(needs.handoff.outputs.category, 'TypeScript') && contains(needs.handoff.outputs.directory, 'web')
with:
subrepo: web
web-prettier:
needs: handoff
uses: ./.github/workflows/Prettier.yml
if: contains(needs.handoff.outputs.directory, 'web')
with:
subrepo: web