fix: use secrets for submodule auth
Release / build (amd64) (push) Failing after 7s
Release / build (arm64) (push) Failing after 6s
Release / generate-latest-json (push) Has been skipped

This commit is contained in:
datadunia
2026-05-06 16:40:09 +07:00
parent 8a8927c8e8
commit 581350971a
+9 -5
View File
@@ -18,11 +18,13 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
submodules: false
- name: Checkout submodules with auth - name: Checkout submodules with auth
run: | run: |
git submodule init 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 git submodule update --init --recursive
- name: Debug - List app directory - name: Debug - List app directory
@@ -64,11 +66,13 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
submodules: false
- name: Checkout submodules with auth - name: Checkout submodules with auth
run: | run: |
git submodule init 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 git submodule update --init --recursive
- name: Download all artifacts - name: Download all artifacts
@@ -92,8 +96,8 @@ jobs:
"release_date": "$RELEASE_DATE", "release_date": "$RELEASE_DATE",
"changelog": $(echo "$CHANGELOG" | jq -R -s '.'), "changelog": $(echo "$CHANGELOG" | jq -R -s '.'),
"download_urls": { "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')", "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 ${{ 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')" "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 EOF
@@ -107,7 +111,7 @@ jobs:
run: | run: |
git config user.name "Gitea Actions" git config user.name "Gitea Actions"
git config user.email "actions@gitea.com" 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 add latest.json
git commit -m "Update latest.json for release ${{ gitea.ref_name }} [skip ci]" || echo "No changes to commit" git commit -m "Update latest.json for release ${{ gitea.ref_name }} [skip ci]" || echo "No changes to commit"
git push origin main git push origin main