-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.17 KB
/
check-editor.yml
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
name: Check Web Editor File Modification Dates
on:
push:
pull_request:
workflow_dispatch:
jobs:
check-last-modification:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compare file dates
run: |
REFERENCE_FILE="web-editor/probe-editor.html"
FILES_TO_COMPARE=(
"web-editor/src/config.js"
"web-editor/src/index.html"
"web-editor/src/modals.js"
"web-editor/src/script.js"
)
# Získání timestampu poslední změny referenčního souboru
REF_DATE=$(git log -1 --format=%ct -- "$REFERENCE_FILE")
echo "$REFERENCE_FILE last modified: $REF_DATE"
for file in "${FILES_TO_COMPARE[@]}"; do
FILE_DATE=$(git log -1 --format=%ct -- "$file")
echo "$file last modified: $FILE_DATE"
if [ "$FILE_DATE" -gt "$REF_DATE" ]; then
echo "❌ $file is newer than $REFERENCE_FILE. Test failed."
exit 1
fi
done
echo "✅ All files are older than $REFERENCE_FILE. Test passed."