Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
K-cermak committed Jan 29, 2025
1 parent 39198a9 commit 3fa0edb
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/check-editor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check Web Editor File Modification Dates

on:
push:
pull_request:
workflow_dispatch:

jobs:
check-dates:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- 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"
)
REF_DATE=$(git log -1 --format=%ct -- "$REFERENCE_FILE" || echo 0)
echo "$REFERENCE_FILE last modified: $REF_DATE"
for file in "${FILES_TO_COMPARE[@]}"; do
FILE_DATE=$(git log -1 --format=%ct -- "$file" || echo 0)
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."

0 comments on commit 3fa0edb

Please sign in to comment.