diff --git a/.github/workflows/pr-path-detection.yml b/.github/workflows/pr-path-detection.yml index 3dbda70b..3d5330e7 100644 --- a/.github/workflows/pr-path-detection.yml +++ b/.github/workflows/pr-path-detection.yml @@ -23,6 +23,7 @@ jobs: - name: Check the Validity of Hyperlinks run: | cd ${{github.workspace}} + timeout=15 # max connect timeout fail="FALSE" retry="FALSE" # url_lines=$(grep -Eo '\]\(http[s]?://[^)]+\)' --include='*.md' -r .|grep -Ev 'linkedin') @@ -30,7 +31,7 @@ jobs: changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')" if [ -n "$changed_files" ]; then for changed_file in $changed_files; do - url_lines=$(grep -H -Eo '\]\(http[s]?://[^)]+\)' "$changed_file" | grep -Ev 'linkedin') || true + url_lines=$(grep -H -Eo '\]\(http[s]?://[^)]+\)' "$changed_file" | sort -u | grep -Ev 'linkedin') || true if [ -n "$url_lines" ]; then for url_line in $url_lines; do url=$(echo "$url_line"|cut -d '(' -f2 | cut -d ')' -f1|sed 's/\.git$//') @@ -39,10 +40,10 @@ jobs: echo "Link "$url" from ${{github.workspace}}/$path need to be verified by a real person." retry="FALSE" else - response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url") + response=$(curl --connect-timeout $timeout -L -s -o /dev/null -w "%{http_code}" "$url") if [ "$response" -ne 200 ]; then echo "**********Validation failed, status code: $response, try again**********" - response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url") + response_retry=$(curl --connect-timeout $timeout -s -o /dev/null -w "%{http_code}" "$url") if [ "$response_retry" -eq 200 ]; then echo "*****Retry successful*****" else @@ -105,15 +106,15 @@ jobs: fail="FALSE" repo_name=${{ github.event.pull_request.head.repo.full_name }} if [ "$(echo "$repo_name"|cut -d'/' -f1)" != "opea-project" ]; then - owner=$(echo "${{ github.event.pull_request.head.repo.full_name }}" |cut -d'/' -f1) - branch="https://github.com/$owner/docs/tree/${{ github.event.pull_request.head.ref }}" + repo_fork=$(echo "${{ github.event.pull_request.head.repo.full_name }}" |cut -d/ -f-2) + branch="https://github.com/$repo_fork/tree/${{ github.event.pull_request.head.ref }}" else branch="https://github.com/opea-project/docs/blob/${{ github.event.pull_request.head.ref }}" fi link_head="https://github.com/opea-project/docs/blob/main" merged_commit=$(git log -1 --format='%H') changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')" - png_lines=$(grep -Eo '\]\([^)]+\)' --include='*.md' -r .|grep -Ev 'http'|grep -Ev 'mailto'|grep -Ev 'portal.azure.com') + png_lines=$(grep -Eo '\]\([^)]+\)' --include='*.md' -r .|sort -u|grep -Ev 'http'|grep -Ev 'mailto'|grep -Ev 'portal.azure.com') if [ -n "$png_lines" ]; then for png_line in $png_lines; do refer_path=$(echo "$png_line"|cut -d':' -f1 | cut -d'/' -f2-) @@ -138,12 +139,12 @@ jobs: url_dev=$branch$(echo "$real_path" | sed 's|.*/docs||')$png_path response=$(curl -I -L -s -o /dev/null -w "%{http_code}" "$url_dev") if [ "$response" -ne 200 ]; then - echo "**********Validation failed, try again**********" + echo "**********Validation failed, status code: $response, try again**********" response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url_dev") if [ "$response_retry" -eq 200 ]; then echo "*****Retry successfully*****" else - echo "Invalid path from ${{github.workspace}}/$refer_path: $png_path, link: $url_dev" + echo "Status code: $response_retry => invalid path from ${{github.workspace}}/$refer_path: $png_path, link: $url_dev" fail="TRUE" fi else diff --git a/tutorial/ChatQnA/deploy/k8s_getting_started.md b/tutorial/ChatQnA/deploy/k8s_getting_started.md index 8a8b6077..46ccd6e0 100644 --- a/tutorial/ChatQnA/deploy/k8s_getting_started.md +++ b/tutorial/ChatQnA/deploy/k8s_getting_started.md @@ -66,8 +66,8 @@ Some commonly used kubectl commands and their functions, assuming that you have **Update Dependencies:** -- A script called **./update_dependency.sh** is provided which is used to update chart dependencies, ensuring all nested charts are at their latest versions. -- The command helm dependency update updates the dependencies for the chart located in the specified directory (e.g., chatqna) based on the versions specified in its Chart.yaml file. +- `scripts/update_dependency.sh` script can be used to ensure that dependencies for `common/` charts are up to date. +- `helm dependency update ` command updates the dependencies for the specified chart directory (e.g., `chatqna`) based on the versions specified in its `Chart.yaml` file. **Helm Install Command:** diff --git a/tutorial/ChatQnA/deploy/k8s_helm.md b/tutorial/ChatQnA/deploy/k8s_helm.md index bc2b7cef..18dbd6b3 100644 --- a/tutorial/ChatQnA/deploy/k8s_helm.md +++ b/tutorial/ChatQnA/deploy/k8s_helm.md @@ -100,7 +100,7 @@ Next, we will update the dependencies for all Helm charts in the specified direc ```bash # All Helm charts in the specified directory have their # dependencies up-to-date, facilitating consistent deployments. -./update_dependency.sh +scripts/update_dependency.sh # "chatqna" here refers to the directory name that contains the Helm # chart for the ChatQnA application