ci: use dynamic repository owner for container images#8548
ci: use dynamic repository owner for container images#8548sheurich wants to merge 3 commits intoletsencrypt:mainfrom
Conversation
.github/workflows/release.yml
Outdated
|
|
||
| - name: Tag Boulder container | ||
| run: docker tag boulder "ghcr.io/letsencrypt/boulder:${GITHUB_REF_NAME}-go${{ matrix.GO_VERSION }}" | ||
| run: docker tag boulder "ghcr.io/${{ github.repository_owner }}/boulder:${GITHUB_REF_NAME}-go${{ matrix.GO_VERSION }}" |
There was a problem hiding this comment.
I'm unconvinced we should make this change at all, as it veers dangerously close to referencing untrusted strings in our workflows and enabling fork- or PR-based attacks. However, if other reviewers think this change is fine, at the very least it should use the environment variable version of this rather than the context preprocessor version, to prevent quote escaping issues.
| run: docker tag boulder "ghcr.io/${{ github.repository_owner }}/boulder:${GITHUB_REF_NAME}-go${{ matrix.GO_VERSION }}" | |
| run: docker tag boulder "ghcr.io/${GITHUB_REPOSITORY_OWNER}/boulder:${GITHUB_REF_NAME}-go${{ matrix.GO_VERSION }}" |
Switch to ${GITHUB_REPOSITORY_OWNER} to avoid expression expansion/quoting issues
Co-authored-by: Aaron Gable <aaron@aarongable.com>
Agree on being cautious, but |
Replace hardcoded
letsencryptwith$GITHUB_REPOSITORY_OWNERin workflow image paths.This enables testing release workflows on forks without modifying the workflow file.
Changes
release.yml:
ghcr.io/letsencrypt/boulder→ghcr.io/$GITHUB_REPOSITORY_OWNER/boulderghcr.io/letsencrypt/ct-test-srv→ghcr.io/$GITHUB_REPOSITORY_OWNER/ct-test-srvtry-release.yml:
ghcr.io/letsencrypt/ct-test-srv→ghcr.io/$GITHUB_REPOSITORY_OWNER/ct-test-srvTesting
Verified by triggering try-release on fork; image paths resolve to fork owner.