forked from LayerLens/stratix-python
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 810 Bytes
/
check-format.yaml
File metadata and controls
37 lines (30 loc) · 810 Bytes
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
name: Check Format
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install Rye
uses: eifinger/setup-rye@v4
with:
version: latest
- name: Sync Rye environment
run: rye sync
- name: Run format script and check output
run: |
set -e # exit on any command failure
OUTPUT=$(./scripts/format 2>&1)
echo "$OUTPUT"
# Fail only if "reformatted" exists
if echo "$OUTPUT" | grep -q "reformatted"; then
echo "Some files were reformatted. Please run './scripts/format' locally and commit changes."
exit 1
fi