fix(ci): restore docker-publish workflow test contract#130
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06292f9835
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🚀 Preview DeploymentYour documentation preview is ready! Preview URL: https://pr-130.comapeo-docs.pages.dev 🔄 Content: Regenerated 5 pages from Notion (content branch was empty, used fallback)
This preview will update automatically when you push new commits to this PR. Built with commit 0b83d5c |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5aef72cccd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
@greptile review |
🧹 Preview Deployment CleanupThe preview deployment for this PR has been cleaned up. Preview URL was: Note: Cloudflare Pages deployments follow automatic retention policies. Old previews are cleaned up automatically. |
* fix(ci): restore docker publish workflow contract * fix(ci): stop PR image comment when push is disabled * Update .github/workflows/docker-publish.yml
* fix(ci): restore docker publish workflow contract * fix(ci): stop PR image comment when push is disabled * Update .github/workflows/docker-publish.yml
* fix(ci): restore docker publish workflow contract * fix(ci): stop PR image comment when push is disabled * Update .github/workflows/docker-publish.yml
* fix(ci): restore docker publish workflow contract * fix(ci): stop PR image comment when push is disabled * Update .github/workflows/docker-publish.yml
Motivation
Description
env.IMAGE_NAMEto use${{ github.repository }}instead of a hardcoded value.packages: writetojobs.build.permissionswhile keepingcontents: readandpull-requests: write.steps.publish.outputs.pushgating with action-native guards by changing the Docker login step toif: github.event_name != 'pull_request'and the build actionpushto${{ github.event_name != 'pull_request' }}.ifto requiregithub.event_name == 'pull_request'andgithub.event.pull_request.head.repo.full_name == github.repositoryso comments only run for non-fork PRs.Testing
bun ito ensure test deps were available.bunx vitest run scripts/docker-publish-workflow.test.ts scripts/ci-validation/docker-publish-workflow.test.ts, and both test files passed (all assertions green).Codex Task
Greptile Overview
Greptile Summary
Restores the docker-publish workflow to match the repository's validation test expectations. The changes ensure proper security by preventing Docker credential exposure to fork PRs while allowing same-repo PRs to receive image build comments.
Key changes:
env.IMAGE_NAMEfrom hardcodedcommunityfirst/comapeo-docs-apito${{ github.repository }}(dynamic repository name)packages: writepermission to job alongside existingcontents: readandpull-requests: writeif: github.event_name != 'pull_request'push: ${{ github.event_name != 'pull_request' }}github.event_name == 'pull_request'ANDgithub.event.pull_request.head.repo.full_name == github.repository(prevents fork PRs from triggering comments that reference non-existent images)All test files pass validation confirming the workflow meets security and functional requirements.
Confidence Score: 5/5
Important Files Changed
${{ github.repository }}for IMAGE_NAME, addspackages: writepermission, gates Docker login/push to non-PR events, and restricts PR comments to same-repo PRsSequence Diagram
sequenceDiagram participant Event as GitHub Event participant Workflow as Docker Publish participant Docker as Docker Hub participant PR as Pull Request alt Push to main branch Event->>Workflow: push event Workflow->>Docker: Login with credentials Workflow->>Docker: Build & push (latest + SHA tags) Workflow->>Workflow: Skip PR comment (not a PR) else Pull Request (same repo) Event->>Workflow: pull_request event (same repo) Workflow->>Workflow: Skip Docker login (is PR) Workflow->>Workflow: Build only (no push) Workflow->>PR: Comment with image reference else Pull Request (fork) Event->>Workflow: pull_request event (fork) Workflow->>Workflow: Skip Docker login (is PR) Workflow->>Workflow: Build only (no push) Workflow->>Workflow: Skip PR comment (fork security) else Manual dispatch Event->>Workflow: workflow_dispatch Workflow->>Docker: Login with credentials Workflow->>Docker: Build & push (ref-based tags) Workflow->>Workflow: Skip PR comment (not a PR) endContext used:
dashboard- CLAUDE.md (source)dashboard- AGENTS.md (source)