From 581350971aa2543f85b0b471c3486ca8686be800 Mon Sep 17 00:00:00 2001 From: datadunia Date: Wed, 6 May 2026 16:40:09 +0700 Subject: [PATCH] fix: use secrets for submodule auth --- .gitea/workflows/release.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 914a843..e3148be 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -18,11 +18,13 @@ jobs: steps: - name: Checkout code uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + submodules: false - name: Checkout submodules with auth run: | git submodule init - git submodule set-url app "https://${{ gitea.actor }}:${{ gitea.token }}@git.datadunia.com/hainzero/WGRplane.git" + git config submodule.app.url "https://${{ secrets.USERNAME }}:${{ secrets.TOKEN }}@git.datadunia.com/hainzero/WGRplane.git" git submodule update --init --recursive - name: Debug - List app directory @@ -64,11 +66,13 @@ jobs: steps: - name: Checkout code uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + submodules: false - name: Checkout submodules with auth run: | git submodule init - git submodule set-url app "https://${{ gitea.actor }}:${{ gitea.token }}@git.datadunia.com/hainzero/WGRplane.git" + git config submodule.app.url "https://${{ secrets.USERNAME }}:${{ secrets.TOKEN }}@git.datadunia.com/hainzero/WGRplane.git" git submodule update --init --recursive - name: Download all artifacts @@ -92,8 +96,8 @@ jobs: "release_date": "$RELEASE_DATE", "changelog": $(echo "$CHANGELOG" | jq -R -s '.'), "download_urls": { - "amd64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ gitea.token }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == "wgrplane-linux-amd64") | .id')", - "arm64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ gitea.token }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == "wgrplane-linux-arm64") | .id')" + "amd64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ secrets.TOKEN }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == \"wgrplane-linux-amd64\") | .id')", + "arm64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ secrets.TOKEN }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == \"wgrplane-linux-arm64\") | .id')" } } EOF @@ -107,7 +111,7 @@ jobs: run: | git config user.name "Gitea Actions" git config user.email "actions@gitea.com" - git remote set-url origin "https://${{ gitea.actor }}:${{ gitea.token }}@${{ gitea.server_url }}/${{ gitea.repository }}.git" + git remote set-url origin "https://${{ secrets.USERNAME }}:${{ secrets.TOKEN }}@${{ gitea.server_url }}/${{ gitea.repository }}.git" git add latest.json git commit -m "Update latest.json for release ${{ gitea.ref_name }} [skip ci]" || echo "No changes to commit" git push origin main