Update .gitea/workflows/deploy-ci.yaml
This commit is contained in:
@@ -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 }}"
|
||||
Reference in New Issue
Block a user