fix: use token auth header for package registry uploads
The GITHUB_TOKEN with basic auth returns 401 reqPackageAccess. Switch to Authorization: token header which grants proper scope.
This commit is contained in:
@@ -42,19 +42,20 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- name: Publish nightly to Generic Package Registry
|
- name: Publish nightly to Generic Package Registry
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/nightly"
|
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/nightly"
|
||||||
echo "Publishing to: $API_BASE"
|
echo "Publishing to: $API_BASE"
|
||||||
echo "Actor: ${{ gitea.actor }}"
|
|
||||||
ls -la gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip 2>/dev/null || true
|
ls -la gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip 2>/dev/null || true
|
||||||
for f in gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip; do
|
for f in gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip; do
|
||||||
[ -f "$f" ] || continue
|
[ -f "$f" ] || continue
|
||||||
echo "Uploading $f..."
|
echo "Uploading $f..."
|
||||||
# Delete old nightly file first (can't overwrite)
|
# Delete old nightly file first (can't overwrite)
|
||||||
curl -k -X DELETE --user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
|
curl -k -X DELETE -H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
"${API_BASE}/${f}" || true
|
"${API_BASE}/${f}" || true
|
||||||
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
|
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
|
||||||
--user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
--upload-file "$f" \
|
--upload-file "$f" \
|
||||||
"${API_BASE}/${f}")
|
"${API_BASE}/${f}")
|
||||||
echo "HTTP response: $HTTP_CODE"
|
echo "HTTP response: $HTTP_CODE"
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- name: Publish to Generic Package Registry
|
- name: Publish to Generic Package Registry
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
VERSION=${GITHUB_REF_NAME#v}
|
VERSION=${GITHUB_REF_NAME#v}
|
||||||
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/${VERSION}"
|
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/${VERSION}"
|
||||||
@@ -67,7 +69,7 @@ jobs:
|
|||||||
[ -f "$f" ] || continue
|
[ -f "$f" ] || continue
|
||||||
echo "Uploading $f..."
|
echo "Uploading $f..."
|
||||||
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
|
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
|
||||||
--user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
--upload-file "$f" \
|
--upload-file "$f" \
|
||||||
"${API_BASE}/${f}")
|
"${API_BASE}/${f}")
|
||||||
echo "HTTP response: $HTTP_CODE"
|
echo "HTTP response: $HTTP_CODE"
|
||||||
|
|||||||
Reference in New Issue
Block a user