Skip to content

Commit

Permalink
Update AutomationPipeline.yml
Browse files Browse the repository at this point in the history
UpdateUpDate
  • Loading branch information
aerryasmani authored Feb 19, 2024
1 parent 7a275ff commit 83ca2e5
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/AutomationPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,16 @@ jobs:
steps:
- name: Check Site Availability and Content
id: site_check
uses: actions/http-client-action@v1
with:
args: |
http -s -I https://phptravels.net -o /dev/null
response_code=$(echo "$output" | yaml -r '.status_code')
content_type=$(echo "$output" | yaml -r '.headers.content_type')
if [ $response_code != 200 ]; then
echo "::error::Site is down with HTTP status code $response_code"
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" -I https://phptravels.net)
if [ "$response" -ne 200 ]; then
echo "::error::Site is down with HTTP status code $response"
exit 1
else
echo "Site is up with HTTP status code $response"
content=$(curl -s https://phptravels.net)
if ! echo "$content" | grep -q "Expected Content"; then
echo "::error::Expected content not found on the page."
exit 1
else
echo "Site is up with HTTP status code $response_code"
echo "Content-Type: $content_type"
content=$(http -s https://phptravels.net)
if ! yaml -r ".($content)" | grep -q "Expected Content"; then
echo "::error::Expected content not found on the page."
exit 1
fi
fi
env:
HTTP_HEADERS: |
User-Agent: MyCustomUserAgent
# ... other jobs
fi

0 comments on commit 83ca2e5

Please sign in to comment.