Bug fixes, add restart command #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
) | |
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." | |
- name: Check editor.html modification date | |
run: | | |
EDITOR_FILE="api/endpoints/editor.html" | |
REF_FILE="web-editor/probe-editor.html" | |
EDITOR_DATE=$(git log -1 --format=%ct -- "$EDITOR_FILE") | |
REF_DATE=$(git log -1 --format=%ct -- "$REF_FILE") | |
echo "$EDITOR_FILE last modified: $EDITOR_DATE" | |
echo "$REF_FILE last modified: $REF_DATE" | |
if [ "$EDITOR_DATE" -lt "$REF_DATE" ]; then | |
echo "❌ $EDITOR_FILE is older than $REF_FILE. Test failed." | |
exit 1 | |
fi | |
echo "✅ $EDITOR_FILE is newer or the same age as $REF_FILE. Test passed." |