File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 46
46
runs-on : ubuntu-latest
47
47
steps :
48
48
- uses : actions/checkout@v3
49
+ - name : Get Commit Hash and generate Version File
50
+ run : echo "$(git rev-parse --short HEAD)" >> public/hash.txt
49
51
- name : Set up Docker Buildx
50
52
uses : docker/setup-buildx-action@v3
51
53
- name : Build and Export Docker image
82
84
- uses : actions/setup-node@v3
83
85
with :
84
86
node-version : 18
87
+ - name : Validate hash.txt file
88
+ run : |
89
+ response=$(curl -s -w "%{http_code}" -o /tmp/hash.txt http://localhost:3000/hash.txt)
90
+ http_code=${response: -3}
91
+ if [ "$http_code" -ne 200 ]; then
92
+ echo "Error: HTTP request failed with status code $http_code"
93
+ exit 1
94
+ fi
95
+ mime_type=$(file --mime-type -b /tmp/hash.txt)
96
+ if [ "$mime_type" != "text/plain" ]; then
97
+ echo "Error: hash.txt does not have MIME type text/plain. Found: $mime_type"
98
+ exit 1
99
+ fi
100
+ content_length=$(wc -c < /tmp/hash.txt | xargs)
101
+ if [ "$content_length" -ge 100 ]; then
102
+ echo "Error: hash.txt content exceeds 100 characters. Length: $content_length"
103
+ exit 1
104
+ fi
105
+ echo "hash.txt is valid with MIME type $mime_type and length $content_length characters."
85
106
- name : Run install
86
107
run : npm ci
87
108
- run : npx playwright install
You can’t perform that action at this time.
0 commit comments