File tree 1 file changed +19
-0
lines changed 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 82
82
- uses : actions/setup-node@v3
83
83
with :
84
84
node-version : 18
85
+ - name : Validate hash.txt file
86
+ run : |
87
+ response=$(curl -s -w "%{http_code}" -o /tmp/hash.txt http://localhost:3000/hash.txt)
88
+ http_code=${response: -3}
89
+ if [ "$http_code" -ne 200 ]; then
90
+ echo "Error: HTTP request failed with status code $http_code"
91
+ exit 1
92
+ fi
93
+ mime_type=$(file --mime-type -b /tmp/hash.txt)
94
+ if [ "$mime_type" != "text/plain" ]; then
95
+ echo "Error: hash.txt does not have MIME type text/plain. Found: $mime_type"
96
+ exit 1
97
+ fi
98
+ content_length=$(wc -c < /tmp/hash.txt | xargs)
99
+ if [ "$content_length" -ge 100 ]; then
100
+ echo "Error: hash.txt content exceeds 100 characters. Length: $content_length"
101
+ exit 1
102
+ fi
103
+ echo "hash.txt is valid with MIME type $mime_type and length $content_length characters."
85
104
- name : Run install
86
105
run : npm ci
87
106
- run : npx playwright install
You can’t perform that action at this time.
0 commit comments