Skip to content

Commit

Permalink
fix: add test for checking existannce of public/hash.txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
ofirc77 committed Jan 15, 2025
1 parent c80089f commit 23d59a7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Validate hash.txt file
run: |
response=$(curl -s -w "%{http_code}" -o /tmp/hash.txt http://localhost:3000/hash.txt)
http_code=${response: -3}
if [ "$http_code" -ne 200 ]; then
echo "Error: HTTP request failed with status code $http_code"
exit 1
fi
mime_type=$(file --mime-type -b /tmp/hash.txt)
if [ "$mime_type" != "text/plain" ]; then
echo "Error: hash.txt does not have MIME type text/plain. Found: $mime_type"
exit 1
fi
content_length=$(wc -c < /tmp/hash.txt | xargs)
if [ "$content_length" -ge 100 ]; then
echo "Error: hash.txt content exceeds 100 characters. Length: $content_length"
exit 1
fi
echo "hash.txt is valid with MIME type $mime_type and length $content_length characters."
- name: Run install
run: npm ci
- run: npx playwright install
Expand Down

0 comments on commit 23d59a7

Please sign in to comment.