Skip to content

Commit

Permalink
chore: add hash.txt to the public folder (#1010)
Browse files Browse the repository at this point in the history
Co-authored-by: Noam Gaash <noam.gaash@applitools.com>
  • Loading branch information
ofirc77 and NoamGaash authored Feb 10, 2025
1 parent 67be2e5 commit 654530c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Commit Hash and generate Version File
run: echo "$(git rev-parse --short HEAD)" >> public/hash.txt
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Export Docker image
Expand Down Expand Up @@ -82,6 +84,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 654530c

Please sign in to comment.