Skip to content

feat: manual on-demand Docker image build workflow for PRs#448

Merged
mandarons merged 2 commits into
mainfrom
copilot/create-docker-image-build-workflow
May 20, 2026
Merged

feat: manual on-demand Docker image build workflow for PRs#448
mandarons merged 2 commits into
mainfrom
copilot/create-docker-image-build-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

Maintainers had no way to build and share a Docker image from a contributor PR without merging to main first, blocking real-user pre-merge testing.

New workflow: ci-pr-build-docker.yml

Adds a workflow_dispatch-only workflow (no automatic triggers) that a maintainer can invoke from the Actions tab with a PR number as input.

Steps:

  • Checks out refs/pull/{pr_number}/head — works for fork PRs where GITHUB_TOKEN permissions would otherwise block automatic builds
  • Captures the actual PR HEAD SHA via git rev-parse HEAD (avoids github.sha which resolves to the default branch in workflow_dispatch context)
  • Builds multi-platform image (linux/amd64, linux/arm64) and pushes to GHCR tagged ghcr.io/mandarons/icloud-docker:pr-{N}
  • Posts a PR comment with pull/run instructions, image digest, and the exact commit SHA built

Permissions scoped to job:

permissions:
  contents: read
  packages: write
  pull-requests: write

The run command in the comment includes the /home/abc/.local volume mount for keyring/session persistence, matching documented container usage.

Based on the commented-out build-and-push-docker job in ci-pr-test.yml, extracted into a standalone manually-triggered workflow.

Copilot AI changed the title [WIP] Create manual docker image build workflow for PRs feat: manual on-demand Docker image build workflow for PRs May 20, 2026
Copilot AI requested a review from mandarons May 20, 2026 06:57
@mandarons mandarons marked this pull request as ready for review May 20, 2026 06:59
Copilot AI review requested due to automatic review settings May 20, 2026 06:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a maintainer-invoked GitHub Actions workflow to build and publish a Docker image for a specified PR, enabling pre-merge testing by pulling a PR-scoped image from GHCR.

Changes:

  • Introduces a workflow_dispatch-only workflow that checks out refs/pull/{N}/head for a provided PR number.
  • Builds and pushes a multi-arch (linux/amd64, linux/arm64) image tagged ghcr.io/<owner>/<repo>:pr-{N}.
  • Posts a PR comment with pull/run instructions, image digest, and the exact PR HEAD SHA that was built.

Comment thread .github/workflows/ci-pr-build-docker.yml
Comment thread .github/workflows/ci-pr-build-docker.yml
Comment thread .github/workflows/ci-pr-build-docker.yml
@mandarons mandarons merged commit f084b3a into main May 20, 2026
4 checks passed
@mandarons mandarons deleted the copilot/create-docker-image-build-workflow branch May 20, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Create manual docker image build workflow for PRs

3 participants