@@ -55,11 +55,17 @@ jobs:
5555 - 'packages/**/*'
5656 anti-cheat:
5757 - 'backend/**/anticheat/**'
58+ workflows:
59+ - '.github/workflows/**/*'
5860
5961 - name : Check Anti-cheat
6062 if : steps.filter.outputs.anti-cheat == 'true'
6163 run : exit 1
6264
65+ - name : Check Workflow Changes
66+ if : steps.filter.outputs.workflows == 'true' && !contains(github.event.pull_request.labels.*.name, 'force-ci') && !contains(github.event.pull_request.labels.*.name, 'force-full-ci')
67+ run : exit 1
68+
6369 - name : Export changes
6470 id : export-changes
6571 run : |
@@ -115,59 +121,9 @@ jobs:
115121 name : Install dependencies
116122 run : pnpm install
117123
118- check-pretty :
119- name : check-pretty
120- needs : [pre-ci, prime-cache]
121- runs-on : ubuntu-latest
122- if : needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || needs.pre-ci.outputs.assets-json == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
123- steps :
124- - uses : actions/checkout@v4
125-
126- - name : Set up Node.js
127- uses : actions/setup-node@v4
128- with :
129- node-version : ${{ env.NODE_VERSION }}
130-
131- - name : Setup pnpm
132- uses : pnpm/action-setup@v4
133- with :
134- version : ${{ env.PNPM_VERSION }}
135-
136- - name : Install prettier
137- run :
pnpm add -g [email protected] 138-
139- - name : Get changed files
140- if : github.event_name == 'pull_request'
141- id : get-changed-files
142- uses : actions/github-script@v7
143- with :
144- script : |
145- const changedFiles = await github.paginate(
146- github.rest.pulls.listFiles,
147- {
148- owner: context.repo.owner,
149- repo: context.repo.repo,
150- pull_number: context.payload.pull_request.number,
151- }
152- );
153- return changedFiles.filter(file=> file.status !== "removed").map(file => file.filename).join(' ');
154-
155- - name : Check pretty (changed files)
156- if : github.event_name == 'pull_request'
157- id : check-pretty
158- run : |
159- CHANGED_FILES=$(echo ${{ steps.get-changed-files.outputs.result }})
160- if [ -n "$CHANGED_FILES" ]; then
161- pnpm prettier --check $CHANGED_FILES
162- fi
163-
164- - name : Check pretty (all files)
165- if : github.event_name == 'push'
166- run : pnpm prettier --check .
167-
168124 ci-be :
169125 name : ci-be
170- needs : [pre-ci, prime-cache, check-pretty ]
126+ needs : [pre-ci, prime-cache]
171127 runs-on : ubuntu-latest
172128 if : needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
173129 steps :
@@ -215,7 +171,7 @@ jobs:
215171
216172 ci-fe :
217173 name : ci-fe
218- needs : [pre-ci, prime-cache, check-pretty ]
174+ needs : [pre-ci, prime-cache]
219175 runs-on : ubuntu-latest
220176 if : needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
221177 steps :
@@ -268,7 +224,7 @@ jobs:
268224
269225 ci-assets :
270226 name : ci-assets
271- needs : [pre-ci, prime-cache, check-pretty ]
227+ needs : [pre-ci, prime-cache]
272228 runs-on : ubuntu-latest
273229 if : needs.pre-ci.outputs.assets-json == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
274230 steps :
@@ -337,7 +293,7 @@ jobs:
337293
338294 ci-pkg :
339295 name : ci-pkg
340- needs : [pre-ci, prime-cache,check-pretty ]
296+ needs : [pre-ci, prime-cache]
341297 runs-on : ubuntu-latest
342298 if : needs.pre-ci.outputs.should-build-pkg == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
343299 steps :
0 commit comments