Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check url of docker image list. #472

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/images_path_detection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Check the validity of links in docker_images_list.

on:
push:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize]

jobs:
check-dockerfile-paths:
runs-on: ubuntu-latest

steps:
- name: Clean Up Working Directory
run: sudo rm -rf ${{github.workspace}}/*

- name: Checkout repo GenAIExamples
uses: actions/checkout@v4

- name: Clone repo GenAIComps
chensuyue marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd ..
git clone https://github.com/opea-project/GenAIComps.git

- name: Check for missing Dockerfile paths in GenAIComps
ZePan110 marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd ${{github.workspace}}
miss="FALSE"
while IFS=: read -r line link; do
http_status=$(curl -o /dev/null -s -w "%{http_code}" "$link")
if [ "$http_status" -eq 200 ]; then
echo "Valid link: $link (Line $line)"
else
echo "Broken link: $link (Line $line) (Status $http_status) "
echo "-----------------retry strat----------------------"
retry_http_status=$(curl -o /dev/null -s -w "%{http_code}" "$link")
if [ "$retry_http_status" -eq 200 ]; then
miss="FALSE"
echo "Valid link: $link (Line $line)"
echo "---------------Retry is valid---------------------"
else
miss="TRUE"
echo "Retry broken link: $link (Line $line) (Status $http_status) "
echo "-------------Retry is not valid-------------------"
fi
fi
done < <(grep -n -oP '(?<=a href=")[^"]*(?=">)' ../../docker_images_list.md)

if [[ "$miss" == "TRUE" ]]; then
exit 1
fi
shell: bash