From 64d0c848ca8661f239ed38f1b4c91639b6a71dd0 Mon Sep 17 00:00:00 2001 From: Arlind Date: Sun, 23 Nov 2025 12:44:39 +0100 Subject: [PATCH] Update .gitea/workflows/deploy-ci.yaml --- .gitea/workflows/deploy-ci.yaml | 38 ++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deploy-ci.yaml b/.gitea/workflows/deploy-ci.yaml index 75c3d1e..765f21b 100644 --- a/.gitea/workflows/deploy-ci.yaml +++ b/.gitea/workflows/deploy-ci.yaml @@ -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 }}" \ No newline at end of file