Update .gitea/workflows/deploy-ci.yaml
This commit is contained in:
@@ -135,6 +135,10 @@ jobs:
|
|||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
mapfile -t repos < "${{ env.REPO_LIST_FILE }}"
|
mapfile -t repos < "${{ env.REPO_LIST_FILE }}"
|
||||||
|
|
||||||
|
# real user (must exist in Gitea)
|
||||||
|
author_name="Arlind"
|
||||||
|
author_email="arlind@sulej.ch"
|
||||||
|
|
||||||
for repo_full in "${repos[@]}"; do
|
for repo_full in "${repos[@]}"; do
|
||||||
owner="${repo_full%%/*}"
|
owner="${repo_full%%/*}"
|
||||||
repo="${repo_full##*/}"
|
repo="${repo_full##*/}"
|
||||||
@@ -143,8 +147,8 @@ jobs:
|
|||||||
|
|
||||||
default_branch=$(curl -sSL -H "Authorization: token ${{ secrets.TOKEN }}" "$api" | jq -r '.default_branch')
|
default_branch=$(curl -sSL -H "Authorization: token ${{ secrets.TOKEN }}" "$api" | jq -r '.default_branch')
|
||||||
|
|
||||||
# process .gitattributes first, then CI template
|
|
||||||
for file in ".gitattributes" "$TEMPLATE_PATH"; do
|
for file in ".gitattributes" "$TEMPLATE_PATH"; do
|
||||||
|
|
||||||
if [[ "$file" == ".gitattributes" ]]; then
|
if [[ "$file" == ".gitattributes" ]]; then
|
||||||
content="${{ needs.fetch-template.outputs.gitattributes_b64 }}"
|
content="${{ needs.fetch-template.outputs.gitattributes_b64 }}"
|
||||||
msg="Update .gitattributes from skins-template"
|
msg="Update .gitattributes from skins-template"
|
||||||
@@ -156,10 +160,6 @@ jobs:
|
|||||||
url="$api/contents/$file"
|
url="$api/contents/$file"
|
||||||
sha=$(curl -sSL -H "Authorization: token ${{ secrets.TOKEN }}" "$url" | jq -r '.sha // empty' || true)
|
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
|
if [[ -z "$sha" ]]; then
|
||||||
action="Add"
|
action="Add"
|
||||||
payload=$(jq -nc \
|
payload=$(jq -nc \
|
||||||
@@ -194,7 +194,9 @@ jobs:
|
|||||||
}')
|
}')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if curl -sSL --fail -X PUT -H "Authorization: token ${{ secrets.TOKEN }}" -H "Content-Type: application/json" \
|
if curl -sSL --fail -X PUT \
|
||||||
|
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
-d "$payload" "$url" >/dev/null; then
|
-d "$payload" "$url" >/dev/null; then
|
||||||
echo "✅ $action successful for $file in $owner/$repo"
|
echo "✅ $action successful for $file in $owner/$repo"
|
||||||
else
|
else
|
||||||
@@ -204,4 +206,4 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
run: rm -f "${{ env.REPO_LIST_FILE }}"
|
run: rm -f "${{ env.REPO_LIST_FILE }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user