Skip to content

Commit 0f234ba

Browse files
jolestarCopilot
andauthored
workflow: authenticate GHCR pulls in holon-solve (#747)
* workflow: add best-effort GHCR auth for holon-solve - request packages:read in holon-solve job permissions\n- attempt docker login to ghcr.io before running holon (best effort)\n- add packages:read to generated holon trigger template\n\nThis fixes private GHCR base image pull failures in downstream repos using holon-solve. * Update .github/workflows/holon-solve.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d9ddb7a commit 0f234ba

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.github/workflows/holon-solve.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ jobs:
582582
issues: write
583583
pull-requests: write
584584
id-token: write
585+
packages: read
585586
outputs:
586587
result: ${{ steps.result.outputs.result }}
587588
summary: ${{ steps.result.outputs.summary }}
@@ -834,6 +835,17 @@ jobs:
834835
fi
835836
docker info
836837
838+
- name: Login to GHCR (best effort)
839+
if: steps.gate.outputs.should_run == 'true' && runner.os == 'Linux'
840+
run: |
841+
set -euo pipefail
842+
843+
if printf '%s' "${{ github.token }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin; then
844+
echo "Authenticated to ghcr.io with github.token."
845+
else
846+
echo "::warning title=GHCR Auth::Failed to authenticate to ghcr.io with github.token. Private GHCR base images may fail to pull. Ensure caller workflow grants permissions.packages=read."
847+
fi
848+
837849
- name: Run Holon
838850
id: run
839851
if: steps.gate.outputs.should_run == 'true'

cmd/holon/templates/workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ permissions:
1717
issues: write
1818
pull-requests: write
1919
id-token: write
20+
packages: read
2021

2122
jobs:
2223
holon:

0 commit comments

Comments
 (0)