Skip to content

[codex] update publish-image workflow#48

Merged
j-shilling merged 24 commits intomainfrom
codex/publish-image-workflow-test
Apr 29, 2026
Merged

[codex] update publish-image workflow#48
j-shilling merged 24 commits intomainfrom
codex/publish-image-workflow-test

Conversation

@j-shilling
Copy link
Copy Markdown
Collaborator

Summary

  • fetch Artifactory credentials from AWS Secrets Manager in bash using jq
  • configure AWS credentials in the publish job and use the fetched credentials for the Artifactory Docker login
  • allow manual runs from any branch and trigger pushes from codex/publish-image-workflow-test, including changes to the workflow file itself

Why

The publish-image workflow was being updated to read Artifactory credentials from Secrets Manager, but the credentials step embedded Python inside a bash block. This keeps that logic in bash, makes branch-based workflow testing easier, and keeps the test run scoped to the current branch before merging.

Impact

The workflow can now be exercised from the test branch, and Artifactory authentication comes from the configured Secrets Manager secret instead of static GitHub secrets.

Validation

  • git diff --check -- .github/workflows/publish-image.yml
  • actionlint .github/workflows/publish-image.yml

@j-shilling j-shilling marked this pull request as ready for review April 23, 2026 15:34
Copilot AI review requested due to automatic review settings April 23, 2026 15:34
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

Updates the publish-image GitHub Actions workflow to authenticate to Artifactory using credentials fetched from AWS Secrets Manager (via OIDC-assumed AWS credentials), and adjusts triggers to support branch-scoped workflow testing.

Changes:

  • Add AWS OIDC permissions + configure-aws-credentials to enable Secrets Manager access during publish.
  • Replace static GitHub secrets usage for Artifactory login with a bash + jq Secrets Manager lookup step.
  • Change push triggers to a test branch (and include the workflow file in paths), and update ECS render step to deploy the SHA-tagged image.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish-image.yml
Comment thread .github/workflows/publish-image.yml
Comment thread .github/workflows/publish-image.yml Outdated
Copilot AI review requested due to automatic review settings April 24, 2026 16:18
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

Updates the publish-image GitHub Actions workflow to fetch Artifactory credentials from AWS Secrets Manager (using jq in bash) and to support branch-scoped workflow testing via a dedicated test branch trigger.

Changes:

  • Configure AWS OIDC credentials in the publish job and fetch Artifactory Docker credentials from AWS Secrets Manager in bash.
  • Update workflow triggers to support branch-based testing and include workflow-file changes in the push path filter.
  • Change ECS render step to deploy the SHA-tagged image instead of the latest tag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish-image.yml
Comment thread .github/workflows/publish-image.yml
Comment thread .github/workflows/publish-image.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 27, 2026 14:26
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

Updates the publish-image GitHub Actions workflow to source Artifactory credentials from AWS Secrets Manager (via AWS OIDC auth) and to make branch-scoped workflow testing easier before merging to the default branch.

Changes:

  • Adjust push trigger to run from codex/publish-image-workflow-test and include the workflow file in the path filter; keep workflow_dispatch enabled for manual runs.
  • Add AWS credential configuration (OIDC role assume) in the publish job and fetch Artifactory Docker credentials from Secrets Manager using aws + jq.
  • Switch Artifactory docker/login-action to use the fetched credentials outputs instead of GitHub Secrets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 29, 2026 14:19
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

Updates the Docker image publishing workflow to authenticate to Artifactory using credentials fetched from AWS Secrets Manager (via bash + jq), and adjusts triggers to support branch-scoped workflow testing before merging.

Changes:

  • Configure AWS credentials (OIDC) in the publish job and fetch Artifactory credentials from Secrets Manager for Docker login.
  • Allow workflow testing via manual dispatch and pushes from codex/publish-image-workflow-test, including workflow-file changes.
  • Switch Docker base images to pull via the Artifactory Docker remote.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Dockerfile Use Artifactory remote images for build/runtime stages; changes Alpine base version.
AGENTS.md Adds explicit runner-label requirements when editing workflow files.
.github/workflows/publish-image.yml Adds AWS credential configuration + Secrets Manager fetch for Artifactory login; adjusts triggers/paths.
.github/AGENTS.md Adds .github/-scoped agent guidance for workflow runner selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile Outdated
Comment thread .github/AGENTS.md Outdated
Copilot AI review requested due to automatic review settings April 29, 2026 14:36
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

Updates the Docker image publishing workflow to authenticate to Artifactory using credentials stored in AWS Secrets Manager (via OIDC-configured AWS credentials), and makes it easier to test workflow changes from a dedicated branch before merging.

Changes:

  • Switch Artifactory Docker login to use username/password fetched from AWS Secrets Manager (parsed with jq) after configuring AWS credentials via OIDC.
  • Adjust workflow triggers to support branch-scoped testing (codex/publish-image-workflow-test) and include workflow file changes in the path filter.
  • Update Docker base images to pull from the Artifactory remote registry; add/extend agent guidance for workflow runner policy.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Dockerfile Pull base images (golang/alpine) from the Artifactory remote registry instead of Docker Hub.
AGENTS.md Document/clarify the required CodeBuild runner label policy for workflow edits.
.github/workflows/publish-image.yml Add AWS credential configuration + Secrets Manager fetch for Artifactory creds; adjust triggers for branch testing; deploy uses SHA-tagged image output.
.github/AGENTS.md Add .github/-scoped agent guidance, including the runner label requirement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/AGENTS.md Outdated
Comment on lines +11 to +12
use the exact label `codebuild-emmy-github-runner-emmy-api-${{
github.run_id }}-${{ github.run_attempt }}`
Copilot AI review requested due to automatic review settings April 29, 2026 14:51
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

Updates the image publishing workflow to source Artifactory credentials from AWS Secrets Manager (via OIDC) and makes it easier to test workflow changes from a dedicated branch, while also shifting Docker base images to be pulled via the Artifactory remote.

Changes:

  • Configure AWS credentials in the publish/deploy jobs and fetch Artifactory Docker credentials from AWS Secrets Manager using jq.
  • Update the publish workflow triggers for branch-scoped testing and include workflow-file path filtering.
  • Switch Docker base images to Artifactory-hosted docker-remote images.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
Dockerfile Switch base images from public registries to Artifactory remote images.
AGENTS.md Document workflow runner-label policy for .github/workflows/*.yml.
.github/workflows/publish-image.yml Add AWS OIDC auth + Secrets Manager credential fetch; adjust triggers; add Artifactory reachability check; update deploy image reference.
.github/AGENTS.md Add scoped .github/ agent guidance, including runner-label requirements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 58 to +61
id: image-metadata
shell: bash
run: |
echo "image_tag=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "image_uri=${IMAGE_REPOSITORY}:${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "latest_image_uri=${IMAGE_REPOSITORY}:latest" >> "$GITHUB_OUTPUT"
{
echo "image_tag=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "image_uri=${IMAGE_REPOSITORY}:${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "latest_image_uri=${IMAGE_REPOSITORY}:latest" >> "$GITHUB_OUTPUT"
{
Comment thread Dockerfile
Comment on lines +1 to 2
FROM --platform=$BUILDPLATFORM artifactory.cloud.cms.gov/docker-remote/library/golang:1.25-alpine AS builder

Comment thread .github/AGENTS.md Outdated
Comment on lines +10 to +12
- Any workflow job in `.github/workflows/*.yml` that declares `runs-on` must
use the exact label `codebuild-emmy-github-runner-emmy-api-${{
github.run_id }}-${{ github.run_attempt }}`
Copilot AI review requested due to automatic review settings April 29, 2026 15:36
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

Updates the container publish workflow to authenticate to Artifactory using credentials retrieved from AWS Secrets Manager (via OIDC + aws/jq), and adjusts the workflow triggers to support branch-scoped testing.

Changes:

  • Update publish-image workflow to configure AWS credentials, fetch Artifactory credentials from Secrets Manager, and use them for Docker registry login.
  • Add workflow trigger support for branch-based testing and include workflow-file changes in the trigger paths.
  • Switch Docker base images to be pulled via the Artifactory remote registry.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Dockerfile Pull Go/Alpine base images from Artifactory remote instead of public registries.
AGENTS.md Documents workflow runner-label policy for agents editing workflows.
.github/workflows/publish-image.yml Adds AWS OIDC auth + Secrets Manager credential fetch; updates Buildx setup and triggers; uses fetched creds for Artifactory login.
.github/AGENTS.md Adds .github/-scoped agent guidance, including runner-label requirements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish-image.yml Outdated
Comment on lines +61 to +66
run: |
docker buildx ls
docker buildx inspect --bootstrap
docker ps --filter name=buildx_buildkit
docker inspect $(docker ps -q --filter name=buildx_buildkit) \
--format '{{.Name}} NetworkMode={{.HostConfig.NetworkMode}}'
Comment thread .github/workflows/publish-image.yml Outdated
Comment on lines +136 to +137
curl -vk --connect-timeout 10 https://artifactory.cloud.cms.gov/v2/
docker run --rm curlimages/curl:latest -vk --connect-timeout 10 https://artifactory.cloud.cms.gov/v2/
Copilot AI review requested due to automatic review settings April 29, 2026 15:48
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

Updates the Docker image publishing workflow to authenticate to Artifactory using credentials fetched from AWS Secrets Manager (via OIDC-configured AWS credentials), and adjusts workflow triggers to support branch-scoped testing.

Changes:

  • Configure AWS credentials in the publish job and fetch Artifactory Docker login credentials from AWS Secrets Manager using jq.
  • Update the publish workflow triggers to enable branch-based workflow testing (including workflow-file changes).
  • Switch Dockerfile base images to pull via the Artifactory docker-remote registry.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Dockerfile Moves golang/alpine base images to Artifactory docker-remote URLs.
AGENTS.md Documents workflow runner label policy for .github/workflows/*.yml.
.github/workflows/publish-image.yml Adds OIDC-based AWS credential setup and Secrets Manager-backed Artifactory login; updates triggers for branch testing.
.github/AGENTS.md Adds .github/-scoped agent guidance emphasizing the workflow runner label policy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS builder
FROM --platform=$BUILDPLATFORM artifactory.cloud.cms.gov/docker-remote/library/golang:1.25-alpine AS builder
Copilot AI review requested due to automatic review settings April 29, 2026 16:02
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

Updates the container publish pipeline to authenticate to Artifactory via AWS Secrets Manager (bash + jq) and makes it easier to test workflow changes on a dedicated branch before merging.

Changes:

  • Switch Docker base images to be pulled via the Artifactory remote registry.
  • Update publish-image workflow to assume an AWS role via OIDC, fetch Artifactory creds from Secrets Manager, and use them for Docker login/build/push.
  • Document workflow runner label requirements in AGENTS.md and add scoped .github/AGENTS.md guidance.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
Dockerfile Pulls Golang/Alpine base images from Artifactory remote instead of public registries.
AGENTS.md Adds explicit workflow runner label policy guidance for agents.
.github/workflows/publish-image.yml Adds AWS credential configuration, Secrets Manager Artifactory creds fetch, and buildx changes; adjusts triggers for branch testing.
.github/AGENTS.md Adds .github/-scoped workflow runner policy documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/AGENTS.md Outdated
Comment on lines +10 to +12
- Any workflow job in `.github/workflows/*.yml` that declares `runs-on` must
use the exact label `codebuild-emmy-github-runner-emmy-api-${{
github.run_id }}-${{ github.run_attempt }}`
Comment thread Dockerfile
Comment on lines 1 to +16
@@ -13,7 +13,7 @@ COPY . .
ENV CGO_ENABLED=0
RUN GOOS="${TARGETOS:-linux}" GOARCH="$TARGETARCH" go build -ldflags="-s -w" -a -o apiserver .

FROM alpine:3.23
FROM artifactory.cloud.cms.gov/docker-remote/library/alpine:3.23
Comment thread .github/workflows/publish-image.yml Outdated
Comment on lines +141 to +145
docker run --rm --network host curlimages/curl:latest \
--noproxy '*' -vk --connect-timeout 10 \
--resolve "artifactory.cloud.cms.gov:443:$ip" \
https://artifactory.cloud.cms.gov/v2/
echo "::endgroup::"
Copilot AI review requested due to automatic review settings April 29, 2026 16:35
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

Updates the container build/publish pipeline to pull Artifactory credentials from AWS Secrets Manager (using bash + jq) and use those credentials for Docker registry login during image publish, while also enabling workflow-file path triggering.

Changes:

  • Switch Artifactory auth in publish-image workflow from GitHub secrets to AWS Secrets Manager (assume-role via OIDC + jq parsing).
  • Adjust Docker Buildx setup and build/push invocation, including builder configuration and proxy settings.
  • Move Docker base images to Artifactory’s docker-remote registry and expand publish-image push path filters to include the workflow file itself.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
Dockerfile Pull builder/runtime base images from Artifactory docker-remote instead of public registries.
AGENTS.md Documents the runner-label requirement for workflow jobs that declare runs-on.
.github/workflows/publish-image.yml Adds AWS credential configuration + Secrets Manager credential fetch; updates Buildx usage; adjusts triggers/paths and deploy image selection.
.github/AGENTS.md Adds scoped .github/ workflow-runner policy guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 5 to 9
branches:
- main
paths:
- ".github/workflows/publish-image.yml"
- "**/*.go"
Comment thread Dockerfile
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS builder
FROM --platform=$BUILDPLATFORM artifactory.cloud.cms.gov/docker-remote/library/golang:1.25-alpine AS builder
Comment thread .github/AGENTS.md Outdated
Comment on lines +11 to +12
use the exact label `codebuild-emmy-github-runner-emmy-api-${{
github.run_id }}-${{ github.run_attempt }}`
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 29, 2026 16:40
Copy link
Copy Markdown
Contributor

@iannorriswork iannorriswork left a comment

Choose a reason for hiding this comment

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

lgtm

@j-shilling j-shilling merged commit 1e7d12e into main Apr 29, 2026
8 checks passed
@j-shilling j-shilling deleted the codex/publish-image-workflow-test branch April 29, 2026 16:42
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

Updates the container publishing pipeline to authenticate to Artifactory using credentials fetched from AWS Secrets Manager (via OIDC), and adjusts container builds to pull base images from the Artifactory remote mirror. Also tightens/clarifies workflow runner policy documentation for contributors/agents.

Changes:

  • Add AWS OIDC credential configuration and Secrets Manager fetch logic (bash + jq) to supply Artifactory Docker login credentials.
  • Update the publish workflow’s Buildx setup and build/push step configuration (including proxy-related settings and metadata output formatting).
  • Switch Dockerfile base images to Artifactory-hosted docker-remote mirrors and document workflow runner label policy in AGENTS files.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Dockerfile Pull Go/Alpine base images from Artifactory remote registry instead of public registries.
AGENTS.md Document the required CodeBuild runner label policy for workflow jobs.
.github/workflows/publish-image.yml Fetch Artifactory creds from Secrets Manager, configure AWS credentials, and use fetched creds for Docker login/build+push.
.github/AGENTS.md Add scoped guidance for .github/ pointing back to root runner policy source-of-truth.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 4 to +8
push:
branches:
- main
paths:
- ".github/workflows/publish-image.yml"
Comment thread Dockerfile
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS builder
FROM --platform=$BUILDPLATFORM artifactory.cloud.cms.gov/docker-remote/library/golang:1.25-alpine AS builder
imhben pushed a commit that referenced this pull request Apr 29, 2026
* feat: update publish-image workflow

* Try docker login cli

* Revert "Try docker login cli"

This reverts commit 3f7be2d.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Tell agents to use self-hosted runners

* Use artifactory for all images

* try a different alphine image

* try adding library to image path

* fix golang is also a library/ image

* Try giving buildx driver access to host network

* add debug step

* move debug step to a useful spot

* Try some more debugging

* fix syntax error

* Use host network

* remove debug step

* remove other debug step

* try disabling proxy

* fix duplicate

* ci: debug Artifactory build connectivity

* ci: fix publish image workflow env

* ci: fix Buildx no proxy option

* ci: clean publish image workflow

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants