Update .gitea/workflows/ci.yml
This commit is contained in:
@@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate Skin Data Files
|
- name: Generate Skin Data Files
|
||||||
id: generate_data
|
id: generate_data
|
||||||
shell: sh
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail # Exit on error, unset variable, or pipeline failure
|
set -euo pipefail # Exit on error, unset variable, or pipeline failure
|
||||||
|
|
||||||
@@ -40,18 +40,21 @@ jobs:
|
|||||||
avatar_rows_file=$(mktemp)
|
avatar_rows_file=$(mktemp)
|
||||||
|
|
||||||
page=1
|
page=1
|
||||||
while :; do
|
users_data_found=true # Flag to control the outer loop
|
||||||
|
while "$users_data_found"; do
|
||||||
echo "Fetching users page $page..." >&2
|
echo "Fetching users page $page..." >&2
|
||||||
users_json=$(curl --fail --retry 3 --retry-delay 5 -sSL \
|
users_json=$(curl --fail --retry 3 --retry-delay 5 -sSL \
|
||||||
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
||||||
"$GITEA_API/admin/users?limit=50&page=$page&_ts=$(date +%s)")
|
"$GITEA_API/admin/users?limit=50&page=$page&_ts=$(date +%s)")
|
||||||
|
|
||||||
if [ "$(echo "$users_json" | jq 'length')" -eq 0 ]; then
|
if [ "$(echo "$users_json" | jq 'length')" -eq 0 ]; then
|
||||||
|
users_data_found=false
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$users_json" | jq -c '.[]' | while read -r user_obj; do
|
mapfile -t user_logins < <(echo "$users_json" | jq -r '.[].login')
|
||||||
user_login=$(echo "$user_obj" | jq -r '.login')
|
|
||||||
|
for user_login in "${user_logins[@]}"; do
|
||||||
echo "Processing user: $user_login" >&2
|
echo "Processing user: $user_login" >&2
|
||||||
|
|
||||||
repos_json=$(curl --fail --retry 3 --retry-delay 5 -sSL \
|
repos_json=$(curl --fail --retry 3 --retry-delay 5 -sSL \
|
||||||
@@ -62,10 +65,12 @@ jobs:
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$repos_json" | jq -c '.[]' | while read -r repo_obj; do
|
mapfile -t repo_details < <(echo "$repos_json" | jq -r '.[] | .owner.login, .name, .html_url')
|
||||||
owner=$(echo "$repo_obj" | jq -r '.owner.login')
|
|
||||||
repo=$(echo "$repo_obj" | jq -r '.name')
|
for ((i=0; i<${#repo_details[@]}; i+=3)); do
|
||||||
html_url=$(echo "$repo_obj" | jq -r '.html_url')
|
owner="${repo_details[i]}"
|
||||||
|
repo="${repo_details[i+1]}"
|
||||||
|
html_url="${repo_details[i+2]}"
|
||||||
|
|
||||||
echo " Checking repo: $repo" >&2
|
echo " Checking repo: $repo" >&2
|
||||||
if ! http_code=$(curl --fail --retry 3 --retry-delay 5 -s -w "%{http_code}" -o readme_content.json \
|
if ! http_code=$(curl --fail --retry 3 --retry-delay 5 -s -w "%{http_code}" -o readme_content.json \
|
||||||
@@ -116,10 +121,10 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "README for $owner/$repo does not match required format" >&2
|
echo "README for $owner/$repo does not match required format" >&2
|
||||||
fi
|
fi
|
||||||
done
|
done # End of for repo_details loop
|
||||||
done
|
done # End of for user_logins loop
|
||||||
page=$((page + 1))
|
page=$((page + 1))
|
||||||
done
|
done # End of while users_data_found loop
|
||||||
|
|
||||||
echo "user_rows_file=$user_rows_file" >> "$GITHUB_OUTPUT"
|
echo "user_rows_file=$user_rows_file" >> "$GITHUB_OUTPUT"
|
||||||
echo "avatar_rows_file=$avatar_rows_file" >> "$GITHUB_OUTPUT"
|
echo "avatar_rows_file=$avatar_rows_file" >> "$GITHUB_OUTPUT"
|
||||||
@@ -193,7 +198,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.email "arlind@sulej.ch"
|
git config user.email "arlind@sulej.ch"
|
||||||
git config user.name "ci-bot"
|
git config user.name "ci-bot"
|
||||||
# Ensure this is correct for your Gitea LFS setup
|
|
||||||
git config lfs.https://${{ vars.CONTAINER_REGISTRY }}/arlind/skins.git/info/lfs.locksverify true
|
git config lfs.https://${{ vars.CONTAINER_REGISTRY }}/arlind/skins.git/info/lfs.locksverify true
|
||||||
|
|
||||||
- name: Add and Commit changes
|
- name: Add and Commit changes
|
||||||
|
|||||||
Reference in New Issue
Block a user