Skip to content

Commit 99226b9

Browse files
committed
feat: Add automated GHCR package visibility setting
Adds a step to automatically set GHCR package visibility to public after pushing Docker images. This ensures the package is publicly accessible without manual intervention. Uses continue-on-error to fail gracefully if permissions are insufficient, with a helpful message directing to the manual settings page. This addresses the issue where GHCR packages default to private visibility.
1 parent d569818 commit 99226b9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,17 @@ jobs:
166166
cache-from: type=gha
167167
cache-to: type=gha,mode=max
168168
platforms: linux/amd64,linux/arm64
169+
170+
- name: Make GHCR package public
171+
continue-on-error: true
172+
run: |
173+
echo "Setting GHCR package visibility to public..."
174+
# Note: This requires the workflow to have admin permissions on the package
175+
# If the package doesn't exist yet or permissions are insufficient, this will fail gracefully
176+
gh api --method PATCH \
177+
-H "Accept: application/vnd.github+json" \
178+
-H "X-GitHub-Api-Version: 2022-11-28" \
179+
"/orgs/utensils/packages/container/mcp-nixos" \
180+
-f visibility=public || echo "Could not set visibility via API. Please set manually at: https://github.com/orgs/utensils/packages/container/mcp-nixos/settings"
181+
env:
182+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)