Update .gitea/workflows/deploy-ci.yaml
All checks were successful
Update Community Skins README / gather-skins (push) Successful in 13s
Update Community Skins README / generate-readme (push) Successful in 3s
Update Community Skins README / commit-readme (push) Has been skipped

This commit is contained in:
2025-11-23 12:44:39 +01:00
parent ef55800044
commit 64d0c848ca

View File

@@ -156,14 +156,42 @@ jobs:
url="$api/contents/$file"
sha=$(curl -sSL -H "Authorization: token ${{ secrets.TOKEN }}" "$url" | jq -r '.sha // empty' || true)
# author + committer used to avoid Gitea default 2001 date
author_name="GitHub Actions"
author_email="actions@github"
if [[ -z "$sha" ]]; then
action="Add"
payload=$(jq -nc --arg message "$msg" --arg content "$content" --arg branch "$default_branch" \
'{message: $message, content: $content, branch: $branch}')
payload=$(jq -nc \
--arg message "$msg" \
--arg content "$content" \
--arg branch "$default_branch" \
--arg author_name "$author_name" \
--arg author_email "$author_email" '
{
message: $message,
content: $content,
branch: $branch,
author: { name: $author_name, email: $author_email },
committer: { name: $author_name, email: $author_email }
}')
else
action="Update"
payload=$(jq -nc --arg message "$msg" --arg content "$content" --arg sha "$sha" --arg branch "$default_branch" \
'{message: $message, content: $content, sha: $sha, branch: $branch}')
payload=$(jq -nc \
--arg message "$msg" \
--arg content "$content" \
--arg sha "$sha" \
--arg branch "$default_branch" \
--arg author_name "$author_name" \
--arg author_email "$author_email" '
{
message: $message,
content: $content,
sha: $sha,
branch: $branch,
author: { name: $author_name, email: $author_email },
committer: { name: $author_name, email: $author_email }
}')
fi
if curl -sSL --fail -X PUT -H "Authorization: token ${{ secrets.TOKEN }}" -H "Content-Type: application/json" \
@@ -176,4 +204,4 @@ jobs:
done
- name: Cleanup
run: rm -f "${{ env.REPO_LIST_FILE }}"
run: rm -f "${{ env.REPO_LIST_FILE }}"