Update .gitea/workflows/deploy-ci.yaml
All checks were successful
Update Community Skins README / Full CI/CD Pipeline (push) Successful in 3s

This commit is contained in:
Arlind
2025-06-09 10:03:07 +02:00
parent 0ce33a6db8
commit 3fa7fab213

View File

@@ -19,7 +19,6 @@ jobs:
- name: Fetch CI template via Gitea API - name: Fetch CI template via Gitea API
shell: bash shell: bash
run: | run: |
set -eo pipefail
resp=$(curl -sSL -H "Authorization: token $TOKEN" \ resp=$(curl -sSL -H "Authorization: token $TOKEN" \
"$GITEA_API/repos/osc/skins-template/contents/$TEMPLATE_PATH?ref=main") "$GITEA_API/repos/osc/skins-template/contents/$TEMPLATE_PATH?ref=main")
template_b64=$(echo "$resp" | jq -r .content) template_b64=$(echo "$resp" | jq -r .content)
@@ -28,7 +27,6 @@ jobs:
- name: Fetch valid user repositories - name: Fetch valid user repositories
shell: bash shell: bash
run: | run: |
set -eo pipefail
page=1 page=1
per_page=50 per_page=50
valid_repos_file=$(mktemp) valid_repos_file=$(mktemp)
@@ -76,34 +74,25 @@ jobs:
echo "VALID_REPOS_FILE=$valid_repos_file" >> $GITHUB_ENV echo "VALID_REPOS_FILE=$valid_repos_file" >> $GITHUB_ENV
- name: Update CI via Gitea API (with debug) - name: Update CI via Gitea API
shell: bash shell: bash
run: | run: |
set -euxo pipefail set -eo pipefail
mapfile -t repos < "$VALID_REPOS_FILE" mapfile -t repos < "$VALID_REPOS_FILE"
for repo_full in "${repos[@]}"; do for repo_full in "${repos[@]}"; do
owner=${repo_full%%/*} owner=${repo_full%%/*}
repo=${repo_full##*/} repo=${repo_full##*/}
api="$GITEA_API/repos/$owner/$repo" api="$GITEA_API/repos/$owner/$repo"
echo "Processing $owner/$repo"
default_branch=$(curl -sSL --fail -H "Authorization: token $TOKEN" \ default_branch=$(curl -sSL --fail -H "Authorization: token $TOKEN" \
"$api" | jq -r '.default_branch') "$api" | jq -r '.default_branch')
echo "Default branch: $default_branch"
latest_tag=$(curl -sSL --fail -H "Authorization: token $TOKEN" \ latest_tag=$(curl -sSL --fail -H "Authorization: token $TOKEN" \
"$api/tags" | jq -r '.[0].name // empty') "$api/tags" | jq -r '.[0].name // empty')
echo "Latest tag: '$latest_tag'"
if [[ -z "$latest_tag" ]]; then if [[ -n "$latest_tag" && "$latest_tag" != "v1.0.0" ]]; then
echo "No tags found, skipping deletion" curl -sSL -X DELETE -H "Authorization: token $TOKEN" \
elif [[ "$latest_tag" == "v1.0.0" ]]; then "$api/tags/$latest_tag" || true
echo "Skipping deletion for protected tag v1.0.0"
else
echo "Deleting tag '$latest_tag'"
delete_response=$(curl -sSL -X DELETE -H "Authorization: token $TOKEN" \
"$api/tags/$latest_tag" -w "%{http_code}" -o /dev/null) || delete_response=error
echo "Delete response code: $delete_response"
fi fi
url="$api/contents/$TEMPLATE_PATH" url="$api/contents/$TEMPLATE_PATH"