feat: enable unauthenticated server startup with runtime OAuth and update CI/CD to append Docker pull instructions to release notes
This commit is contained in:
@@ -51,7 +51,7 @@ jobs:
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.MY_BUILDTOKEN }}
|
||||
password: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
@@ -88,3 +88,37 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||
|
||||
- name: Update Gitea Release Notes
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||
|
||||
# Fetch the current release
|
||||
RELEASE_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/${TAG_NAME})
|
||||
|
||||
# Extract Release ID (if it exists)
|
||||
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id // empty')
|
||||
|
||||
if [ -n "$RELEASE_ID" ] && [ "$RELEASE_ID" != "null" ]; then
|
||||
OLD_BODY=$(echo "$RELEASE_JSON" | jq -r '.body // ""')
|
||||
|
||||
# Check if Docker Image section already exists
|
||||
if [[ "$OLD_BODY" != *"## 🐳 Docker Image"* ]]; then
|
||||
NEW_BODY="${OLD_BODY}\n\n## 🐳 Docker Image\n\`\`\`bash\ndocker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG_NAME}\n\`\`\`"
|
||||
|
||||
jq -n --arg body "$NEW_BODY" '{body: $body}' | \
|
||||
curl -s -X PATCH \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @- \
|
||||
${{ github.api_url }}/repos/${{ github.repository }}/releases/${RELEASE_ID}
|
||||
|
||||
echo "Successfully updated Release Notes for $TAG_NAME"
|
||||
else
|
||||
echo "Release Notes already contain the Docker pull command."
|
||||
fi
|
||||
else
|
||||
echo "No associated release found for tag $TAG_NAME. Skipping."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user