Skip to content

Commit 1b211fa

Browse files
committed
Check whether automatic update is possible
1 parent b74e06d commit 1b211fa

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/update-fls.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
- name: Install uv
1313
uses: astral-sh/setup-uv@v6
1414
- name: Update FLS
15-
run: "./make.py --update-spec-lock-file"
15+
run: |
16+
./test_update_fls.sh
1617
- name: Create Pull Request
1718
uses: peter-evans/create-pull-request@v4
1819
with:

test_update_fls.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
./make.py
4+
if [ $? -eq "0" ];then
5+
echo "FLS is up to date"
6+
exit 0 # No error, no update required
7+
else
8+
grep -q "ERROR: The FLS specification has changed since the lock file was created:" test.txt
9+
OUTOFDATE=$?
10+
grep -q "Found differences between live FLS data and lock file affecting 0 guidelines" test.txt
11+
ZEROAFFECTED=$?
12+
13+
if [ $OUTOFDATE -eq "0" ]; then
14+
if [ $ZEROAFFECTED -eq "0" ]; then
15+
./make.py --update-spec-lock-file
16+
rm test.txt
17+
exit 1 # Can be updated automatically
18+
else
19+
./make.py --update-spec-lock-file
20+
rm test.txt
21+
exit 2 # Guidelines need human review
22+
fi
23+
fi
24+
fi
25+
26+
rm test.txt
27+
exit 3 # Other build error not related to FLS

0 commit comments

Comments
 (0)