Skip to content

major changes in containers deployment. #9

Open
ypriverol wants to merge 27 commits intomainfrom
dev
Open

major changes in containers deployment. #9
ypriverol wants to merge 27 commits intomainfrom
dev

Conversation

@ypriverol
Copy link
Copy Markdown
Member

@ypriverol ypriverol commented Apr 9, 2026

This pull request updates the GitHub Actions workflow for building and publishing Docker and Singularity images, focusing on improved maintainability, flexibility, and security. The main changes include parameterizing image names and registry details, updating authentication methods, refining job conditions, and enhancing the build and notification steps.

Container Image Parameterization and Flexibility:

  • Introduced environment variables (REGISTRY, IMAGE_NAME, SINGULARITY_IMAGE_NAME) to make image naming and registry usage more flexible and reusable across jobs.
  • Updated all image references in the build matrices to use ${{ github.repository_owner }} instead of hardcoded values, enabling workflows to work for forks and other organizations.

Build and Push Improvements:

  • Enhanced the build-diann job with improved naming, retry logic, metadata extraction, and tagging strategies (including date-based tags). [1] [2]
  • Added explicit steps for pulling, saving, converting, and pushing Docker images to Singularity, and included notifications for build success or failure.

Authentication and Security Updates:

  • Standardized authentication to use ${{ github.repository_owner }} as the username and ${{ secrets.GITHUB_TOKEN }} for password, replacing previous usage of ${{ github.actor }} and custom tokens. This improves security and consistency across jobs. [1] [2] [3] [4]

Conditional Execution and Permissions:

  • Added conditions to restrict certain jobs (e.g., build-relink, sync-openms) to only run for the bigbio organization, preventing accidental pushes from forks or other users. [1] [2]

Workflow Usability and Clarity:

  • Improved job and step naming for better clarity in the Actions UI.
  • Added explicit notifications for build outcomes, making it easier to monitor workflow results.

These changes collectively make the workflow more robust, secure, and easier to maintain.

Summary by CodeRabbit

  • Chores
    • Standardized container build and deployment pipeline for consistent releases.
    • Switched registry auth to repository-aware tokens and updated image tagging to use repository owner metadata.
    • Improved Singularity image conversion, save/push flow, and registry push gating for push runs.
    • Added success/failure notifications for image builds.
    • Restricted certain build jobs to run only for the repository owner.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

Centralizes registry env, replaces hardcoded ghcr.io/bigbio with ghcr.io/${{ github.repository_owner }}, switches GHCR auth to secrets.GITHUB_TOKEN, refactors DIA‑NN Docker→Singularity build/push flow, adds DIA‑NN success/failure notifications, and gates Relink/OpenMS jobs to repository owner and push-image inputs.

Changes

Cohort / File(s) Summary
GitHub Actions workflow
.github/workflows/quantms-containers.yml
Added top-level env.REGISTRY, replaced hardcoded ghcr.io/bigbio with ghcr.io/${{ github.repository_owner }}, switched auth from secrets.GHCR_TOKEN to secrets.GITHUB_TOKEN (including singularity remote login), reworked DIA‑NN Singularity conversion to docker save.tarsingularity buildoras push via eWaterCycle/setup-singularity@v7, adjusted push gating to github.event.inputs.push_images and constrained build-relink/sync-openms jobs to github.repository_owner == 'bigbio', and added DIA‑NN success/failure notification steps.

Sequence Diagram(s)

sequenceDiagram
participant Actions as GitHub Actions
participant Docker as Docker Engine
participant Singularity as Singularity CLI
participant GHCR as GHCR / ORAS

Actions->>Docker: build image(s) (matrix)
Docker->>Docker: docker save -> ${matrix}.tar
Actions->>Singularity: singularity build ${matrix}.sif from ${matrix}.tar
Singularity->>GHCR: singularity remote login (GITHUB_TOKEN)
Singularity->>GHCR: oras push ${matrix}.sif to ghcr.io/${{ github.repository_owner }}
GHCR-->>Actions: push result
Actions->>Actions: run success()/failure() notification steps
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • ypriverol

Poem

🐰 I hopped through YAML lines so spry,

Swapped hardcoded names and waved them bye,
Saved a tar, built a SIF with care,
Pushed with tokens through the crisp night air,
CI carrots glow — containers in the sky!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using the non-descriptive term 'major changes' without specifying what was actually changed or why. Replace with a more specific title that describes the primary change, such as 'Update containers workflow to use GitHub token and dynamic registry ownership' or 'Refactor workflow to support forks with dynamic REGISTRY and github.repository_owner'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
.github/workflows/quantms-containers.yml (2)

254-260: Hardcoded bigbio in Singularity push URIs.

While the job condition ensures this only runs for bigbio (line 214), the hardcoded URIs at lines 256 and 259 are inconsistent with the parameterized approach used in build-diann (lines 192, 197). Consider using ${{ github.repository_owner }} for consistency.

Suggested change
-          singularity push image.sif oras://ghcr.io/bigbio/${{ matrix.sif }}
+          singularity push image.sif oras://ghcr.io/${{ github.repository_owner }}/${{ matrix.sif }}
           if [[ "${{ github.event_name }}" == "release" && -n "${{ matrix.extra_tags }}" ]]; then
             SIF_LATEST=$(echo "${{ matrix.sif }}" | sed 's/:[^:]*$/:latest/')
-            singularity push image.sif oras://ghcr.io/bigbio/$SIF_LATEST
+            singularity push image.sif oras://ghcr.io/${{ github.repository_owner }}/$SIF_LATEST
           fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 254 - 260, The
Singularity push URIs are hardcoded to "bigbio" which breaks consistency with
the parameterized owner used elsewhere; update the two singularity push targets
that reference ghcr.io/bigbio/${{ matrix.sif }} and ghcr.io/bigbio/$SIF_LATEST
to use the repository owner variable (e.g., ghcr.io/${{ github.repository_owner
}}/${{ matrix.sif }} and ghcr.io/${{ github.repository_owner }}/$SIF_LATEST) so
they match the parameterized pattern used by build-diann and respect different
repo owners.

28-31: SINGULARITY_IMAGE_NAME environment variable is defined but never used.

The SINGULARITY_IMAGE_NAME env var is defined at line 31, but the Singularity push steps (lines 192, 197) use ${{ matrix.sif }} instead. Either use this env var consistently or remove it to avoid confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 28 - 31, The
SINGULARITY_IMAGE_NAME env var is defined but not used; update the workflow to
either remove SINGULARITY_IMAGE_NAME or make the Singularity push steps use it
consistently by replacing occurrences of `${{ matrix.sif }}` with the
environment variable `${{ env.SINGULARITY_IMAGE_NAME }}` (or set `matrix.sif`
from that env var); locate references to SINGULARITY_IMAGE_NAME and the push
steps that reference `matrix.sif` to ensure a single source of truth and update
the push step arguments and any matrix definitions accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/quantms-containers.yml:
- Around line 138-149: The meta and date steps are producing outputs that are
never consumed; either remove the dead steps (ids meta and date) or wire their
outputs into the build step: expose docker/metadata-action outputs (e.g., use
steps.meta.outputs.tags or steps.meta.outputs.image) and the date step output
(steps.date.outputs.DATE_TAG) and replace matrix.tag / matrix.extra_tags in the
build-push-action invocation with the corresponding steps.meta.outputs.* and
steps.date.outputs.DATE_TAG references so the extracted tags are actually used.
- Around line 131-136: The Docker login in the build-diann job is using
github.actor while build-relink and sync-openms use github.repository_owner;
update the build-diann job's docker/login-action step (the "Log in to GitHub
Container Registry" step) to set username: ${{ github.repository_owner }} to
match the other jobs, or add a short comment in that step explaining why
github.actor must differ if there's an intentional reason—ensure consistency
across the jobs (build-diann, build-relink, sync-openms) by using
github.repository_owner unless a documented exception is required.
- Around line 121-123: RETRY_TIMES and RETRY_DELAY are defined but never used;
either remove these unused env vars or wire them into retry steps: update the
workflow to reference RETRY_TIMES and RETRY_DELAY when adding retry behavior
(for example by using the nick-fields/retry@v2 action like in the sync-openms
job) so that the retry action reads the environment variables (RETRY_TIMES,
RETRY_DELAY) to control attempts and delay, or simply delete RETRY_TIMES and
RETRY_DELAY from the env block if no retry logic is required.
- Line 155: Replace the current push condition so it only reads workflow inputs
for workflow_dispatch events and compares the input as a string; specifically,
change the push condition to check github.event_name == 'workflow_dispatch' &&
(github.event.inputs.push_images == 'true' || github.event.inputs.push_images ==
'') instead of the boolean comparison, and apply this same change to the other
push conditions referenced (the additional push: occurrences on the same
workflow). This ensures inputs are only evaluated for workflow_dispatch and uses
string comparisons for github.event.inputs.push_images.

---

Nitpick comments:
In @.github/workflows/quantms-containers.yml:
- Around line 254-260: The Singularity push URIs are hardcoded to "bigbio" which
breaks consistency with the parameterized owner used elsewhere; update the two
singularity push targets that reference ghcr.io/bigbio/${{ matrix.sif }} and
ghcr.io/bigbio/$SIF_LATEST to use the repository owner variable (e.g.,
ghcr.io/${{ github.repository_owner }}/${{ matrix.sif }} and ghcr.io/${{
github.repository_owner }}/$SIF_LATEST) so they match the parameterized pattern
used by build-diann and respect different repo owners.
- Around line 28-31: The SINGULARITY_IMAGE_NAME env var is defined but not used;
update the workflow to either remove SINGULARITY_IMAGE_NAME or make the
Singularity push steps use it consistently by replacing occurrences of `${{
matrix.sif }}` with the environment variable `${{ env.SINGULARITY_IMAGE_NAME }}`
(or set `matrix.sif` from that env var); locate references to
SINGULARITY_IMAGE_NAME and the push steps that reference `matrix.sif` to ensure
a single source of truth and update the push step arguments and any matrix
definitions accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f2177863-7053-466d-846e-386c8f0057a0

📥 Commits

Reviewing files that changed from the base of the PR and between 4357944 and b16e4b1.

📒 Files selected for processing (1)
  • .github/workflows/quantms-containers.yml

Comment thread .github/workflows/quantms-containers.yml Outdated
Comment thread .github/workflows/quantms-containers.yml
Comment thread .github/workflows/quantms-containers.yml Outdated
Comment thread .github/workflows/quantms-containers.yml
@enryH
Copy link
Copy Markdown
Collaborator

enryH commented Apr 9, 2026

So the login fails with your user as well. Before you used repository secrets, so maybe your GHCR setup is different?

now:

echo *** | singularity remote login -u ypriverol --password-stdin oras://ghcr.io

# Push with version tag
singularity push diann-2.3.2.sif oras://ghcr.io/bigbio/diann-sif:2.3.2

before:

export SINGULARITY_DOCKER_USERNAME=***
export SINGULARITY_DOCKER_PASSWORD=***
singularity push image.sif oras://ghcr.io/bigbio/diann-sif:2.3.2

@ypriverol
Copy link
Copy Markdown
Member Author

What is the difference with the current main branch; the login and push works with the current approach; better to do not changed it; I have tried other approaches in the past that didn't work.

- Fix critical bug: push condition used broken input comparison that
  would push images on pull_request events. Restored safe guard:
  github.event_name != 'pull_request' (build always, push only on merge)
- Remove dead code: unused metadata-action step, date tag step,
  RETRY_TIMES/RETRY_DELAY env vars, and IMAGE_NAME/SINGULARITY_IMAGE_NAME
- Standardize Docker login to use github.repository_owner across all jobs
- Standardize Singularity install (eWaterCycle/setup-singularity@v7) and
  auth (singularity remote login --password-stdin) across all jobs,
  replacing fragile apt-get || true and env-var-based auth
- Replace all hardcoded bigbio refs in push URIs with github.repository_owner
- Remove redundant docker pull (image already loaded via load: true)

https://claude.ai/code/session_01UFH8ge5154Z8q4DCEbQCTX
@enryH
Copy link
Copy Markdown
Collaborator

enryH commented Apr 10, 2026

What is the difference with the current main branch; the login and push works with the current approach; better to do not changed it; I have tried other approaches in the past that didn't work.

I think there is a way to use Personal Access Tokens which are set based on the user's repository permission. I had to do nothing to be able to push images to our ghcr.

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-in-a-github-actions-workflow

claude and others added 2 commits April 10, 2026 07:01
secrets.GITHUB_TOKEN is scoped to the workflow actor, so the login
username must match. Using github.repository_owner causes 401 errors
when the actor differs from the owner (e.g. collaborators, bots).

Applies to all 3 Docker logins and all 3 Singularity logins.

https://claude.ai/code/session_01UFH8ge5154Z8q4DCEbQCTX
Refactor container workflows to use dynamic registry and repository owner
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/quantms-containers.yml (1)

138-140: Empty extra_tags produces blank line in tags input.

When matrix.extra_tags is an empty string (e.g., for diann-2.2.0 through diann-1.8.1), the tags block will contain a trailing blank line. While docker/build-push-action typically handles this gracefully, it's cleaner to conditionally include the extra tag.

♻️ Proposed fix using conditional expression
          tags: |
            ${{ matrix.tag }}
-           ${{ matrix.extra_tags }}
+           ${{ matrix.extra_tags != '' && matrix.extra_tags || '' }}

Or use a multi-line conditional in the step:

          tags: ${{ matrix.extra_tags != '' && format('{0}{1}{2}', matrix.tag, '\n', matrix.extra_tags) || matrix.tag }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 138 - 140, The tags
input may contain a trailing blank line when matrix.extra_tags is an empty
string; update the workflow step that sets tags (the tags: input used with
docker/build-push-action) to conditionally include matrix.extra_tags only when
non-empty (e.g., replace the current multi-line tags block with a single
expression that concatenates matrix.tag and matrix.extra_tags only if
matrix.extra_tags != '' so you don't emit a blank line).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/quantms-containers.yml:
- Around line 237-243: Replace the direct use of GitHub secrets in the
Singularity authentication step by reading credentials from the environment
variables SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD;
specifically, change the singularity remote login invocation that currently uses
${{ secrets.GITHUB_TOKEN }} and ${{ github.actor }} to use these env vars
instead (keep the target URL oras://ghcr.io), so the echo/--password-stdin
pattern uses SINGULARITY_DOCKER_PASSWORD and the -u flag uses
SINGULARITY_DOCKER_USERNAME; leave the subsequent singularity push commands
(singularity push image.sif oras://ghcr.io/${{ github.repository_owner }}/${{
matrix.sif }} and the SIF_LATEST push logic using matrix.sif and SIF_LATEST)
unchanged.
- Around line 290-297: Replace the inline secrets usage in the "Sync OpenMS
Singularity" step with an environment variable like SINGULARITY_REMOTE_TOKEN
(set in the job's env from secrets.GITHUB_TOKEN), and change the login command
to echo "$SINGULARITY_REMOTE_TOKEN" | singularity remote login -u ${{
github.actor }} --password-stdin; keep the rest of the step (singularity
pull/push and conditional push on release) unchanged so authentication is
consistent with other jobs that use the environment variable approach.
- Around line 164-176: Replace the `singularity remote login` + `echo ${{
secrets.GITHUB_TOKEN }}` approach in the "Login and Deploy Container" step with
environment-based authentication by exporting SINGULARITY_DOCKER_USERNAME and
SINGULARITY_DOCKER_PASSWORD from secrets (e.g., set env:
SINGULARITY_DOCKER_USERNAME: ${{ secrets.SINGULARITY_DOCKER_USERNAME }} and
SINGULARITY_DOCKER_PASSWORD: ${{ secrets.SINGULARITY_DOCKER_PASSWORD }}) and
remove the persistent `singularity remote login` call; also stop using `echo` to
pass secrets (if you must pass a secret to a command, use printf '%s' or a
secure heredoc) and then call `singularity push ${{ matrix.context }}.sif
oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.sif }}` and
the existing latest-tag logic (SIF_LATEST/Singularity push) unchanged so pushes
continue to use the matrix.sif and matrix.context variables securely.

---

Nitpick comments:
In @.github/workflows/quantms-containers.yml:
- Around line 138-140: The tags input may contain a trailing blank line when
matrix.extra_tags is an empty string; update the workflow step that sets tags
(the tags: input used with docker/build-push-action) to conditionally include
matrix.extra_tags only when non-empty (e.g., replace the current multi-line tags
block with a single expression that concatenates matrix.tag and
matrix.extra_tags only if matrix.extra_tags != '' so you don't emit a blank
line).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 02b036a5-cf2f-416d-a13d-9beeeaf2baf3

📥 Commits

Reviewing files that changed from the base of the PR and between b16e4b1 and df0d2ba.

📒 Files selected for processing (1)
  • .github/workflows/quantms-containers.yml

Comment on lines +164 to 176
- name: Login and Deploy Container
if: github.event_name != 'pull_request'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io

# Push with version tag
singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.sif }}

# If this is a release event, also tag as latest
if [[ "${{ github.event_name }}" == "release" && -n "${{ matrix.extra_tags }}" ]]; then
SIF_LATEST=$(echo "${{ matrix.sif }}" | sed 's/:[^:]*$/:latest/')
singularity push image.sif oras://ghcr.io/bigbio/$SIF_LATEST
singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/$SIF_LATEST
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Singularity ORAS push authentication SINGULARITY_DOCKER_USERNAME vs remote login

💡 Result:

For singularity push ... oras://... (OCI/ORAS registry), Singularity can authenticate in two different ways:

1) SINGULARITY_DOCKER_USERNAME / SINGULARITY_DOCKER_PASSWORD (or flags)

  • These are registry credentials used for docker:// and oras:// operations.
  • They’re typically used for non-interactive/CI runs (or you can pass --docker-username/--docker-password on the command).
  • In SingularityCE, these env vars take precedence over credentials loaded from an authfile / stored logins. [2]

2) singularity remote login (stored login)

  • Despite the name, remote login can log in not only to a Sylabs “remote endpoint”, but also directly to an OCI/Docker registry, including an oras:// registry URI. [1]
  • It stores the token/password in a docker-config-style file under your home directory (e.g. ~/.singularity/docker-config.json). [2]

Practical rule

  • Use env vars / flags when you want ephemeral, job-scoped auth (CI, batch jobs, avoiding writing creds to disk). [2]
  • Use remote login (or, in SingularityCE 4.x, the newer singularity registry login) when you want a persistent local login that future oras:// pushes/pulls will reuse automatically. [1][2]

Sources: SingularityCE remote login docs (shows oras://... registry login) [1]; SingularityCE 4.1 user guide (credential storage + precedence of SINGULARITY_DOCKER_*) [2].


Use environment variables for Singularity authentication in CI—best practice and more secure.

This approach has two issues:

  1. CI best practice: For GitHub Actions (ephemeral CI jobs), SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD environment variables are the documented recommended approach. The singularity remote login method stores credentials persistently to disk (~/.singularity/docker-config.json), which is unsuitable for transient CI environments.

  2. Security: Using echo ${{ secrets.GITHUB_TOKEN }} can leak the secret in debug logs or error output. Use printf without a trailing newline or a heredoc instead.

Recommended fix using environment variables
      - name: Login and Deploy Container
        if: github.event_name != 'pull_request'
+       env:
+         SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
+         SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
        run: |
-         echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
-
          # Push with version tag
          singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.sif }}

          # If this is a release event, also tag as latest
          if [[ "${{ github.event_name }}" == "release" && -n "${{ matrix.extra_tags }}" ]]; then
            SIF_LATEST=$(echo "${{ matrix.sif }}" | sed 's/:[^:]*$/:latest/')
            singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/$SIF_LATEST
          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Login and Deploy Container
if: github.event_name != 'pull_request'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
# Push with version tag
singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.sif }}
# If this is a release event, also tag as latest
if [[ "${{ github.event_name }}" == "release" && -n "${{ matrix.extra_tags }}" ]]; then
SIF_LATEST=$(echo "${{ matrix.sif }}" | sed 's/:[^:]*$/:latest/')
singularity push image.sif oras://ghcr.io/bigbio/$SIF_LATEST
singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/$SIF_LATEST
fi
- name: Login and Deploy Container
if: github.event_name != 'pull_request'
env:
SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
# Push with version tag
singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.sif }}
# If this is a release event, also tag as latest
if [[ "${{ github.event_name }}" == "release" && -n "${{ matrix.extra_tags }}" ]]; then
SIF_LATEST=$(echo "${{ matrix.sif }}" | sed 's/:[^:]*$/:latest/')
singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/$SIF_LATEST
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 164 - 176, Replace the
`singularity remote login` + `echo ${{ secrets.GITHUB_TOKEN }}` approach in the
"Login and Deploy Container" step with environment-based authentication by
exporting SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD from
secrets (e.g., set env: SINGULARITY_DOCKER_USERNAME: ${{
secrets.SINGULARITY_DOCKER_USERNAME }} and SINGULARITY_DOCKER_PASSWORD: ${{
secrets.SINGULARITY_DOCKER_PASSWORD }}) and remove the persistent `singularity
remote login` call; also stop using `echo` to pass secrets (if you must pass a
secret to a command, use printf '%s' or a secure heredoc) and then call
`singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{
github.repository_owner }}/${{ matrix.sif }}` and the existing latest-tag logic
(SIF_LATEST/Singularity push) unchanged so pushes continue to use the matrix.sif
and matrix.context variables securely.

Comment on lines +237 to +243

echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io

singularity push image.sif oras://ghcr.io/${{ github.repository_owner }}/${{ matrix.sif }}
if [[ "${{ github.event_name }}" == "release" && -n "${{ matrix.extra_tags }}" ]]; then
SIF_LATEST=$(echo "${{ matrix.sif }}" | sed 's/:[^:]*$/:latest/')
singularity push image.sif oras://ghcr.io/bigbio/$SIF_LATEST
singularity push image.sif oras://ghcr.io/${{ github.repository_owner }}/$SIF_LATEST
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Same Singularity authentication concerns apply here.

This step uses the same singularity remote login pattern that has reported issues. Apply the same fix using environment variables (SINGULARITY_DOCKER_USERNAME, SINGULARITY_DOCKER_PASSWORD) as suggested for the build-diann job.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 237 - 243, Replace the
direct use of GitHub secrets in the Singularity authentication step by reading
credentials from the environment variables SINGULARITY_DOCKER_USERNAME and
SINGULARITY_DOCKER_PASSWORD; specifically, change the singularity remote login
invocation that currently uses ${{ secrets.GITHUB_TOKEN }} and ${{ github.actor
}} to use these env vars instead (keep the target URL oras://ghcr.io), so the
echo/--password-stdin pattern uses SINGULARITY_DOCKER_PASSWORD and the -u flag
uses SINGULARITY_DOCKER_USERNAME; leave the subsequent singularity push commands
(singularity push image.sif oras://ghcr.io/${{ github.repository_owner }}/${{
matrix.sif }} and the SIF_LATEST push logic using matrix.sif and SIF_LATEST)
unchanged.

Comment on lines 290 to +297
- name: Sync OpenMS Singularity
run: |
sudo apt-get update && sudo apt-get install -y singularity-container || true
export SINGULARITY_DOCKER_USERNAME=${{ secrets.GHCR_USERNAME }}
export SINGULARITY_DOCKER_PASSWORD=${{ secrets.GHCR_TOKEN }}
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io

singularity pull --force openms.sif oras://ghcr.io/openms/openms-tools-thirdparty-sif:latest
singularity push openms.sif oras://ghcr.io/bigbio/openms-tools-thirdparty-sif:${{ env.OPENMS_VERSION }}
singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:${{ env.OPENMS_VERSION }}
if [[ "${{ github.event_name }}" == "release" ]]; then
singularity push openms.sif oras://ghcr.io/bigbio/openms-tools-thirdparty-sif:latest
singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Same Singularity authentication concerns apply here.

Apply the environment variable approach for consistency with the fix in other jobs.

🔒 Proposed fix
      - name: Sync OpenMS Singularity
+       env:
+         SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
+         SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
        run: |
-         echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
-
          singularity pull --force openms.sif oras://ghcr.io/openms/openms-tools-thirdparty-sif:latest
          singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:${{ env.OPENMS_VERSION }}
          if [[ "${{ github.event_name }}" == "release" ]]; then
            singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:latest
          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Sync OpenMS Singularity
run: |
sudo apt-get update && sudo apt-get install -y singularity-container || true
export SINGULARITY_DOCKER_USERNAME=${{ secrets.GHCR_USERNAME }}
export SINGULARITY_DOCKER_PASSWORD=${{ secrets.GHCR_TOKEN }}
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
singularity pull --force openms.sif oras://ghcr.io/openms/openms-tools-thirdparty-sif:latest
singularity push openms.sif oras://ghcr.io/bigbio/openms-tools-thirdparty-sif:${{ env.OPENMS_VERSION }}
singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:${{ env.OPENMS_VERSION }}
if [[ "${{ github.event_name }}" == "release" ]]; then
singularity push openms.sif oras://ghcr.io/bigbio/openms-tools-thirdparty-sif:latest
singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:latest
- name: Sync OpenMS Singularity
env:
SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
singularity pull --force openms.sif oras://ghcr.io/openms/openms-tools-thirdparty-sif:latest
singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:${{ env.OPENMS_VERSION }}
if [[ "${{ github.event_name }}" == "release" ]]; then
singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:latest
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 290 - 297, Replace the
inline secrets usage in the "Sync OpenMS Singularity" step with an environment
variable like SINGULARITY_REMOTE_TOKEN (set in the job's env from
secrets.GITHUB_TOKEN), and change the login command to echo
"$SINGULARITY_REMOTE_TOKEN" | singularity remote login -u ${{ github.actor }}
--password-stdin; keep the rest of the step (singularity pull/push and
conditional push on release) unchanged so authentication is consistent with
other jobs that use the environment variable approach.

@ypriverol ypriverol requested a review from enryH April 10, 2026 09:01
@Skitionek
Copy link
Copy Markdown

Here is probably why things didn't work as expected in this reppo: singularityhub/github-ci#6

@ypriverol
Copy link
Copy Markdown
Member Author

@enryH @Skitionek everything looks OK now. Can you review the current PR for me to merge.

with:
context: ./${{ matrix.context }}
push: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
push: ${{ github.event_name != 'pull_request' }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this what you want?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this also means that we are not testing this atm with the PR, no?

@enryH
Copy link
Copy Markdown
Collaborator

enryH commented Apr 10, 2026

@enryH @Skitionek everything looks OK now. Can you review the current PR for me to merge.

it looks good because you changed the condition again. So we will only see if the steps work after merging:
https://github.com/bigbio/quantms-containers/actions/runs/24232765139/job/70747974897 (see which steps are skipped due to the changed if statement again).

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (4)
.github/workflows/quantms-containers.yml (4)

237-243: ⚠️ Potential issue | 🟠 Major

Same Singularity authentication concerns apply here.

Apply the environment variable approach (SINGULARITY_DOCKER_USERNAME, SINGULARITY_DOCKER_PASSWORD) for consistency and security.

🔒 Recommended fix
      - name: Convert to Singularity and push
        if: github.event_name != 'pull_request'
+       env:
+         SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
+         SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
        run: |
          docker save ${{ matrix.tag }} -o image.tar
          singularity build image.sif docker-archive://image.tar

-         echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
-
          singularity push image.sif oras://ghcr.io/${{ github.repository_owner }}/${{ matrix.sif }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 237 - 243, Replace the
inline echo of the GitHub token and direct use of github.actor with
environment-backed credentials: set env variables SINGULARITY_DOCKER_USERNAME
and SINGULARITY_DOCKER_PASSWORD (mapped from repository secrets) at the job
level, then call singularity remote login using -u $SINGULARITY_DOCKER_USERNAME
and piping $SINGULARITY_DOCKER_PASSWORD (instead of echo ${{
secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }}
--password-stdin); keep the subsequent singularity push lines intact so pushes
to oras://ghcr.io/${{ github.repository_owner }}/${{ matrix.sif }} and the
conditional latest push still run. Ensure the new env variable names are used
consistently in the workflow and that secrets are referenced when defining those
env vars.

290-297: ⚠️ Potential issue | 🟠 Major

Same Singularity authentication concerns apply here.

Apply the environment variable approach for consistency.

🔒 Recommended fix
      - name: Sync OpenMS Singularity
+       env:
+         SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
+         SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
        run: |
-         echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
-
          singularity pull --force openms.sif oras://ghcr.io/openms/openms-tools-thirdparty-sif:latest
          singularity push openms.sif oras://ghcr.io/${{ github.repository_owner }}/openms-tools-thirdparty-sif:${{ env.OPENMS_VERSION }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 290 - 297, The
Singularity authentication in the "Sync OpenMS Singularity" step currently
echoes the GitHub token directly; change it to use the environment variable
pattern used elsewhere by piping "${{ env.SINGULARITY_AUTH_TOKEN }}" into
singularity remote login (keep the existing flags: -u ${{ github.actor }}
--password-stdin) and ensure the job/workflow defines env.SINGULARITY_AUTH_TOKEN
= ${{ secrets.SINGULARITY_AUTH_TOKEN }} (or map from the existing secret you use
elsewhere) so authentication is consistent and secrets are not referenced
inline; update both singularity login usages in this step and any duplicate
blocks to use the same env variable.

164-176: ⚠️ Potential issue | 🟠 Major

Use environment variables for Singularity authentication instead of remote login.

As previously flagged: (1) echo ${{ secrets.GITHUB_TOKEN }} can leak secrets in debug logs; (2) singularity remote login stores credentials to disk, which is unsuitable for ephemeral CI. Use SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD environment variables instead.

🔒 Recommended fix
      - name: Login and Deploy Container
-       if: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
+       if: ${{ github.event_name != 'pull_request' && github.event.inputs.push_images != 'false' }}
+       env:
+         SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
+         SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
        run: |
-         echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
-
          # Push with version tag
          singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.sif }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 164 - 176, The current
job uses echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login which risks
leaking secrets to logs and writes credentials to disk; replace that flow by
exporting SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD from
GitHub secrets (do not echo them) and run singularity push directly (e.g.,
export SINGULARITY_DOCKER_USERNAME="${{ secrets.SINGULARITY_DOCKER_USERNAME }}"
&& export SINGULARITY_DOCKER_PASSWORD="${{ secrets.SINGULARITY_DOCKER_PASSWORD
}}" && singularity push ${matrix.context}.sif oras://${{ env.REGISTRY }}/${{
github.repository_owner }}/${{ matrix.sif }}), and apply the same pattern for
the release/tag-latest branch that pushes $SIF_LATEST; remove the singularity
remote login call and ensure no secret is printed to stdout so credentials are
only provided via environment variables.

136-136: ⚠️ Potential issue | 🔴 Critical

Push condition will fail to push images on push and release events.

For push/release events, github.event.inputs is undefined, causing both comparisons to fail. This means Docker images will never be pushed for these event types—only for workflow_dispatch. Compare with build-relink (line 217) which correctly uses github.event_name != 'pull_request'.

🐛 Proposed fix
-          push: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
+          push: ${{ github.event_name != 'pull_request' && github.event.inputs.push_images != 'false' }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml at line 136, The push condition
uses github.event.inputs which is undefined for push/release events so images
never get pushed; replace the current line starting with "push: ${{
(github.event.inputs.push_images..." with a condition that mirrors build-relink,
e.g. use "push: ${{ github.event_name != 'pull_request' }}" (or otherwise check
github.event_name != 'pull_request') so push/release events will allow image
pushes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/quantms-containers.yml:
- Around line 145-162: Update the three Singularity workflow steps ("Set up
Singularity", "Save Docker image for Singularity conversion", and "Convert
Docker image to Singularity") to use the corrected push condition
github.event_name != 'pull_request' && github.event.inputs.push_images !=
'false' instead of the current broken expression; keep the same actions (using
eWaterCycle/setup-singularity@v7, docker save of matrix.tag to
matrix.context.tar, and singularity build docker-archive://matrix.context.tar to
produce matrix.context.sif) but change their if: expressions so Singularity
conversion runs on push/release and only skips when inputs.push_images is
explicitly 'false'.

---

Duplicate comments:
In @.github/workflows/quantms-containers.yml:
- Around line 237-243: Replace the inline echo of the GitHub token and direct
use of github.actor with environment-backed credentials: set env variables
SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD (mapped from
repository secrets) at the job level, then call singularity remote login using
-u $SINGULARITY_DOCKER_USERNAME and piping $SINGULARITY_DOCKER_PASSWORD (instead
of echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{
github.actor }} --password-stdin); keep the subsequent singularity push lines
intact so pushes to oras://ghcr.io/${{ github.repository_owner }}/${{ matrix.sif
}} and the conditional latest push still run. Ensure the new env variable names
are used consistently in the workflow and that secrets are referenced when
defining those env vars.
- Around line 290-297: The Singularity authentication in the "Sync OpenMS
Singularity" step currently echoes the GitHub token directly; change it to use
the environment variable pattern used elsewhere by piping "${{
env.SINGULARITY_AUTH_TOKEN }}" into singularity remote login (keep the existing
flags: -u ${{ github.actor }} --password-stdin) and ensure the job/workflow
defines env.SINGULARITY_AUTH_TOKEN = ${{ secrets.SINGULARITY_AUTH_TOKEN }} (or
map from the existing secret you use elsewhere) so authentication is consistent
and secrets are not referenced inline; update both singularity login usages in
this step and any duplicate blocks to use the same env variable.
- Around line 164-176: The current job uses echo ${{ secrets.GITHUB_TOKEN }} |
singularity remote login which risks leaking secrets to logs and writes
credentials to disk; replace that flow by exporting SINGULARITY_DOCKER_USERNAME
and SINGULARITY_DOCKER_PASSWORD from GitHub secrets (do not echo them) and run
singularity push directly (e.g., export SINGULARITY_DOCKER_USERNAME="${{
secrets.SINGULARITY_DOCKER_USERNAME }}" && export
SINGULARITY_DOCKER_PASSWORD="${{ secrets.SINGULARITY_DOCKER_PASSWORD }}" &&
singularity push ${matrix.context}.sif oras://${{ env.REGISTRY }}/${{
github.repository_owner }}/${{ matrix.sif }}), and apply the same pattern for
the release/tag-latest branch that pushes $SIF_LATEST; remove the singularity
remote login call and ensure no secret is printed to stdout so credentials are
only provided via environment variables.
- Line 136: The push condition uses github.event.inputs which is undefined for
push/release events so images never get pushed; replace the current line
starting with "push: ${{ (github.event.inputs.push_images..." with a condition
that mirrors build-relink, e.g. use "push: ${{ github.event_name !=
'pull_request' }}" (or otherwise check github.event_name != 'pull_request') so
push/release events will allow image pushes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6dc6b58a-a311-4202-bd04-8a44c2094064

📥 Commits

Reviewing files that changed from the base of the PR and between df0d2ba and c0474c2.

📒 Files selected for processing (1)
  • .github/workflows/quantms-containers.yml

Comment on lines +145 to +162
- name: Set up Singularity
if: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.8.7

- name: Save Docker image for Singularity conversion
if: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
run: |
sudo apt-get update && sudo apt-get install -y singularity-container || true
docker save ${{ matrix.tag }} -o image.tar
singularity build image.sif docker-archive://image.tar
export SINGULARITY_DOCKER_USERNAME=${{ secrets.GHCR_USERNAME }}
export SINGULARITY_DOCKER_PASSWORD=${{ secrets.GHCR_TOKEN }}
singularity push image.sif oras://ghcr.io/bigbio/${{ matrix.sif }}
docker save ${{ matrix.tag }} -o ${{ matrix.context }}.tar

- name: Convert Docker image to Singularity
if: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
run: |
# Convert Docker tar to Singularity SIF
singularity build ${{ matrix.context }}.sif docker-archive://${{ matrix.context }}.tar
# Verify the SIF file exists
ls -la ${{ matrix.context }}.sif
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Singularity steps share the same broken push condition.

Lines 146, 152, and 157 use the same condition as line 136, which will prevent Singularity conversion on push and release events. Apply the same fix (github.event_name != 'pull_request' && github.event.inputs.push_images != 'false') to all these conditions.

The approach of using eWaterCycle/setup-singularity@v7 and the docker savesingularity build flow is sound.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 145 - 162, Update the
three Singularity workflow steps ("Set up Singularity", "Save Docker image for
Singularity conversion", and "Convert Docker image to Singularity") to use the
corrected push condition github.event_name != 'pull_request' &&
github.event.inputs.push_images != 'false' instead of the current broken
expression; keep the same actions (using eWaterCycle/setup-singularity@v7,
docker save of matrix.tag to matrix.context.tar, and singularity build
docker-archive://matrix.context.tar to produce matrix.context.sif) but change
their if: expressions so Singularity conversion runs on push/release and only
skips when inputs.push_images is explicitly 'false'.

@enryH
Copy link
Copy Markdown
Collaborator

enryH commented Apr 10, 2026

@enryH
Copy link
Copy Markdown
Collaborator

enryH commented Apr 10, 2026

Once we know it works, I can revert the last commit then it should be ready to merge.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
.github/workflows/quantms-containers.yml (2)

168-179: ⚠️ Potential issue | 🟠 Major

Use env-based Singularity registry auth in CI instead of remote login.

The PR thread already reports failures with this exact singularity remote login ... oras://ghcr.io flow, and these three jobs still rely on it. SingularityCE explicitly documents SINGULARITY_DOCKER_USERNAME / SINGULARITY_DOCKER_PASSWORD as the CI/CD-friendly path, while registry logins are stored for reuse rather than kept purely job-scoped. I’d switch these jobs back to env-based auth before singularity push. (docs.sylabs.io)

Suggested fix pattern
-      - name: Login and Deploy Container
+      - name: Login and Deploy Container
+        env:
+          SINGULARITY_DOCKER_USERNAME: ${{ github.actor }}
+          SINGULARITY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
         run: |
-          echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
-
           # Push with version tag
           singularity push ${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.sif }}

Also applies to: 236-247, 294-301

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 168 - 179, Replace the
ephemeral `singularity remote login ... oras://ghcr.io` step with
environment-based auth by exporting SINGULARITY_DOCKER_USERNAME and
SINGULARITY_DOCKER_PASSWORD from GitHub secrets before the `singularity push`
calls (e.g., export SINGULARITY_DOCKER_USERNAME="${{ github.actor }}" and export
SINGULARITY_DOCKER_PASSWORD="${{ secrets.GITHUB_TOKEN }}"), remove the
`singularity remote login` invocation, and keep the existing `singularity push
${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner
}}/${{ matrix.sif }}` and the conditional push to the latest tag; apply the same
replacement to the other two similar job blocks that use `singularity remote
login` (the blocks that also run `singularity push` with
`matrix.context`/`matrix.sif`).

140-169: ⚠️ Potential issue | 🔴 Critical

The publish guard is still using the wrong input context.

github.event.inputs.push_images is string-typed, so == true never matches, and the == '' fallback is unsafe because GitHub coerces null to '' in expressions. Since this same condition gates both the Docker push and all Singularity publish steps here, non-workflow_dispatch events can still satisfy the guard unexpectedly. Use the boolean-preserving inputs context and gate it by event name instead. (docs.github.com)

Suggested fix
-          push: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
+          push: ${{ github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.push_images) }}
-        if: ${{ (github.event.inputs.push_images == true || github.event.inputs.push_images == '') }}
+        if: ${{ github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || inputs.push_images) }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 140 - 169, Replace the
current publish guard expressions that use github.event.inputs.push_images with
a guard that first checks the event type and then uses the boolean-preserving
inputs context; e.g. for the steps "Set up Singularity", "Save Docker image for
Singularity conversion", "Convert Docker image to Singularity" and "Login and
Deploy Container" change the if: to something like: if: ${{ github.event_name ==
'workflow_dispatch' && (inputs.push_images == true || inputs.push_images == '')
}} so the condition uses github.event_name and inputs.push_images (not
github.event.inputs) to avoid string coercion and unexpected matches.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/quantms-containers.yml:
- Around line 182-186: The success notice step ("Notify on success") currently
runs unconditionally on success and claims Docker and Singularity images were
pushed; update this step so it only claims pushes when the publish condition
actually ran (e.g., add the publish guard to the step's if: expression such as
combining success() with the same publish condition used for the image push
steps or a job output like needs.publish.result == 'success'), or change the
echo text to a neutral message (e.g., "Successfully built DiaNN ${{
matrix.context }} images (pushed when publish enabled)") so it doesn't assert
pushes when publish was skipped; modify the step named "Notify on success" and
its echo string accordingly.
- Around line 70-77: The DIANN_ALL matrix contains a hardcoded namespace for the
diann-2.5.0 entry: update the "tag" value in the diann-2.5.0 object (within
DIANN_ALL) to use the templated owner instead of ghcr.io/bigbio (i.e. replace
ghcr.io/bigbio with ghcr.io/${{ github.repository_owner }}), and ensure any
related fields (like "extra_tags" if intended) follow the same owner templating
so the workflow_dispatch/release runs publish under the repository_owner for
diann-2.5.0 as with the other diann entries.
- Line 196: The condition using always() allows downstream jobs to run even when
predecessors failed; change the if expressions for the build-relink job (which
currently checks always() && needs.detect-changes.outputs.has_relink == 'true'
&& github.repository_owner == 'bigbio') to instead require that the
predecessor(s) succeeded or were skipped, e.g. check needs.build-diann.result ==
'success' || needs.build-diann.result == 'skipped' (and/or
needs.detect-changes.result similarly) combined with
needs.detect-changes.outputs.has_relink == 'true' and github.repository_owner ==
'bigbio'; do the same for the sync-openms job so it only publishes when prior
jobs like build-diann and build-relink have result == 'success' or 'skipped'
rather than using always().

---

Duplicate comments:
In @.github/workflows/quantms-containers.yml:
- Around line 168-179: Replace the ephemeral `singularity remote login ...
oras://ghcr.io` step with environment-based auth by exporting
SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD from GitHub secrets
before the `singularity push` calls (e.g., export
SINGULARITY_DOCKER_USERNAME="${{ github.actor }}" and export
SINGULARITY_DOCKER_PASSWORD="${{ secrets.GITHUB_TOKEN }}"), remove the
`singularity remote login` invocation, and keep the existing `singularity push
${{ matrix.context }}.sif oras://${{ env.REGISTRY }}/${{ github.repository_owner
}}/${{ matrix.sif }}` and the conditional push to the latest tag; apply the same
replacement to the other two similar job blocks that use `singularity remote
login` (the blocks that also run `singularity push` with
`matrix.context`/`matrix.sif`).
- Around line 140-169: Replace the current publish guard expressions that use
github.event.inputs.push_images with a guard that first checks the event type
and then uses the boolean-preserving inputs context; e.g. for the steps "Set up
Singularity", "Save Docker image for Singularity conversion", "Convert Docker
image to Singularity" and "Login and Deploy Container" change the if: to
something like: if: ${{ github.event_name == 'workflow_dispatch' &&
(inputs.push_images == true || inputs.push_images == '') }} so the condition
uses github.event_name and inputs.push_images (not github.event.inputs) to avoid
string coercion and unexpected matches.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee43c3af-9f65-4dfe-811c-efe27f062bbc

📥 Commits

Reviewing files that changed from the base of the PR and between c0474c2 and 5ad93e4.

📒 Files selected for processing (1)
  • .github/workflows/quantms-containers.yml

Comment on lines 70 to +77
DIANN_ALL='[
{"context":"diann-2.5.0","tag":"ghcr.io/bigbio/diann:2.5.0","sif":"diann-sif:2.5.0","extra_tags":"ghcr.io/bigbio/diann:latest","chg":"CHG_250"},
{"context":"diann-2.3.2","tag":"ghcr.io/bigbio/diann:2.3.2","sif":"diann-sif:2.3.2","extra_tags":"","chg":"CHG_232"},
{"context":"diann-2.2.0","tag":"ghcr.io/bigbio/diann:2.2.0","sif":"diann-sif:2.2.0","extra_tags":"","chg":"CHG_220"},
{"context":"diann-2.1.0","tag":"ghcr.io/bigbio/diann:2.1.0","sif":"diann-sif:2.1.0","extra_tags":"","chg":"CHG_210"},
{"context":"diann-2.0.2","tag":"ghcr.io/bigbio/diann:2.0.2","sif":"diann-sif:2.0.2","extra_tags":"","chg":"CHG_20"},
{"context":"diann-1.9.2","tag":"ghcr.io/bigbio/diann:1.9.2","sif":"diann-sif:1.9.2","extra_tags":"","chg":"CHG_192"},
{"context":"diann-1.8.1","tag":"ghcr.io/bigbio/diann:1.8.1","sif":"diann-sif:1.8.1","extra_tags":"","chg":"CHG_181"}
{"context":"diann-2.3.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.3.2","sif":"diann-sif:2.3.2","extra_tags":"","chg":"CHG_232"},
{"context":"diann-2.2.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.2.0","sif":"diann-sif:2.2.0","extra_tags":"","chg":"CHG_220"},
{"context":"diann-2.1.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.1.0","sif":"diann-sif:2.1.0","extra_tags":"","chg":"CHG_210"},
{"context":"diann-2.0.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.0.2","sif":"diann-sif:2.0.2","extra_tags":"","chg":"CHG_20"},
{"context":"diann-1.9.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:1.9.2","sif":"diann-sif:1.9.2","extra_tags":"","chg":"CHG_192"},
{"context":"diann-1.8.1","tag":"ghcr.io/${{ github.repository_owner }}/diann:1.8.1","sif":"diann-sif:1.8.1","extra_tags":"","chg":"CHG_181"}
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Apr 15, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

diann-2.5.0 is still pinned to ghcr.io/bigbio.

This block updates the later DIA-NN entries to ${{ github.repository_owner }}, but leaves the 2.5.0 matrix entry on the hardcoded namespace. release / workflow_dispatch will still publish that one image to bigbio, so forks and org mirrors remain broken for the newest image.

Suggested fix
-            {"context":"diann-2.5.0","tag":"ghcr.io/bigbio/diann:2.5.0","sif":"diann-sif:2.5.0","extra_tags":"ghcr.io/bigbio/diann:latest","chg":"CHG_250"},
+            {"context":"diann-2.5.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.5.0","sif":"diann-sif:2.5.0","extra_tags":"ghcr.io/${{ github.repository_owner }}/diann:latest","chg":"CHG_250"},
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DIANN_ALL='[
{"context":"diann-2.5.0","tag":"ghcr.io/bigbio/diann:2.5.0","sif":"diann-sif:2.5.0","extra_tags":"ghcr.io/bigbio/diann:latest","chg":"CHG_250"},
{"context":"diann-2.3.2","tag":"ghcr.io/bigbio/diann:2.3.2","sif":"diann-sif:2.3.2","extra_tags":"","chg":"CHG_232"},
{"context":"diann-2.2.0","tag":"ghcr.io/bigbio/diann:2.2.0","sif":"diann-sif:2.2.0","extra_tags":"","chg":"CHG_220"},
{"context":"diann-2.1.0","tag":"ghcr.io/bigbio/diann:2.1.0","sif":"diann-sif:2.1.0","extra_tags":"","chg":"CHG_210"},
{"context":"diann-2.0.2","tag":"ghcr.io/bigbio/diann:2.0.2","sif":"diann-sif:2.0.2","extra_tags":"","chg":"CHG_20"},
{"context":"diann-1.9.2","tag":"ghcr.io/bigbio/diann:1.9.2","sif":"diann-sif:1.9.2","extra_tags":"","chg":"CHG_192"},
{"context":"diann-1.8.1","tag":"ghcr.io/bigbio/diann:1.8.1","sif":"diann-sif:1.8.1","extra_tags":"","chg":"CHG_181"}
{"context":"diann-2.3.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.3.2","sif":"diann-sif:2.3.2","extra_tags":"","chg":"CHG_232"},
{"context":"diann-2.2.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.2.0","sif":"diann-sif:2.2.0","extra_tags":"","chg":"CHG_220"},
{"context":"diann-2.1.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.1.0","sif":"diann-sif:2.1.0","extra_tags":"","chg":"CHG_210"},
{"context":"diann-2.0.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.0.2","sif":"diann-sif:2.0.2","extra_tags":"","chg":"CHG_20"},
{"context":"diann-1.9.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:1.9.2","sif":"diann-sif:1.9.2","extra_tags":"","chg":"CHG_192"},
{"context":"diann-1.8.1","tag":"ghcr.io/${{ github.repository_owner }}/diann:1.8.1","sif":"diann-sif:1.8.1","extra_tags":"","chg":"CHG_181"}
DIANN_ALL='[
{"context":"diann-2.5.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.5.0","sif":"diann-sif:2.5.0","extra_tags":"ghcr.io/${{ github.repository_owner }}/diann:latest","chg":"CHG_250"},
{"context":"diann-2.3.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.3.2","sif":"diann-sif:2.3.2","extra_tags":"","chg":"CHG_232"},
{"context":"diann-2.2.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.2.0","sif":"diann-sif:2.2.0","extra_tags":"","chg":"CHG_220"},
{"context":"diann-2.1.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.1.0","sif":"diann-sif:2.1.0","extra_tags":"","chg":"CHG_210"},
{"context":"diann-2.0.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.0.2","sif":"diann-sif:2.0.2","extra_tags":"","chg":"CHG_20"},
{"context":"diann-1.9.2","tag":"ghcr.io/${{ github.repository_owner }}/diann:1.9.2","sif":"diann-sif:1.9.2","extra_tags":"","chg":"CHG_192"},
{"context":"diann-1.8.1","tag":"ghcr.io/${{ github.repository_owner }}/diann:1.8.1","sif":"diann-sif:1.8.1","extra_tags":"","chg":"CHG_181"}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 70 - 77, The DIANN_ALL
matrix contains a hardcoded namespace for the diann-2.5.0 entry: update the
"tag" value in the diann-2.5.0 object (within DIANN_ALL) to use the templated
owner instead of ghcr.io/bigbio (i.e. replace ghcr.io/bigbio with ghcr.io/${{
github.repository_owner }}), and ensure any related fields (like "extra_tags" if
intended) follow the same owner templating so the workflow_dispatch/release runs
publish under the repository_owner for diann-2.5.0 as with the other diann
entries.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

correct. to be changed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@enryH, thanks for confirming! Here's the specific change needed for the diann-2.5.0 entry:

-            {"context":"diann-2.5.0","tag":"ghcr.io/bigbio/diann:2.5.0","sif":"diann-sif:2.5.0","extra_tags":"ghcr.io/bigbio/diann:latest","chg":"CHG_250"},
+            {"context":"diann-2.5.0","tag":"ghcr.io/${{ github.repository_owner }}/diann:2.5.0","sif":"diann-sif:2.5.0","extra_tags":"ghcr.io/${{ github.repository_owner }}/diann:latest","chg":"CHG_250"},

Both the tag and extra_tags fields need updating so the 2.5.0 (latest) image is consistent with all the other DIA-NN entries.

Comment on lines +182 to +186
- name: Notify on success
if: success()
run: |
echo "::notice::Successfully built and pushed DiaNN ${{ matrix.context }} Docker and Singularity images to ghcr.io/${{ github.repository_owner }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Success notification is inaccurate on build-only runs.

On pull_request runs—or on workflow_dispatch when push_images is false—the publish steps can be skipped, but this notice still says both Docker and Singularity images were pushed. Gate the notice with the publish condition or change the wording to reflect build-only success.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml around lines 182 - 186, The success
notice step ("Notify on success") currently runs unconditionally on success and
claims Docker and Singularity images were pushed; update this step so it only
claims pushes when the publish condition actually ran (e.g., add the publish
guard to the step's if: expression such as combining success() with the same
publish condition used for the image push steps or a job output like
needs.publish.result == 'success'), or change the echo text to a neutral message
(e.g., "Successfully built DiaNN ${{ matrix.context }} images (pushed when
publish enabled)") so it doesn't assert pushes when publish was skipped; modify
the step named "Notify on success" and its echo string accordingly.

name: "Relink ${{ matrix.context }}"
needs: [detect-changes, build-diann]
if: always() && needs.detect-changes.outputs.has_relink == 'true'
if: always() && needs.detect-changes.outputs.has_relink == 'true' && github.repository_owner == 'bigbio'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd .github/workflows && wc -l quantms-containers.yml

Repository: bigbio/quantms-containers

Length of output: 95


🏁 Script executed:

cat -n .github/workflows/quantms-containers.yml | sed -n '180,210p'

Repository: bigbio/quantms-containers

Length of output: 1361


🏁 Script executed:

cat -n .github/workflows/quantms-containers.yml | sed -n '240,270p'

Repository: bigbio/quantms-containers

Length of output: 1576


🏁 Script executed:

cat -n .github/workflows/quantms-containers.yml | sed -n '1,50p'

Repository: bigbio/quantms-containers

Length of output: 1865


🏁 Script executed:

rg -n "needs\." .github/workflows/quantms-containers.yml | head -20

Repository: bigbio/quantms-containers

Length of output: 397


🏁 Script executed:

cat -n .github/workflows/quantms-containers.yml | sed -n '40,50p'

Repository: bigbio/quantms-containers

Length of output: 573


🏁 Script executed:

cat -n .github/workflows/quantms-containers.yml | sed -n '110,130p'

Repository: bigbio/quantms-containers

Length of output: 846


🏁 Script executed:

cat -n .github/workflows/quantms-containers.yml | sed -n '192,200p'

Repository: bigbio/quantms-containers

Length of output: 501


🏁 Script executed:

cat -n .github/workflows/quantms-containers.yml | sed -n '250,260p'

Repository: bigbio/quantms-containers

Length of output: 575


always() allows downstream jobs to publish even after upstream failures.

GitHub Actions treats always() as "run even if a needed job did not succeed." In this workflow:

  • build-relink (line 196) can push images even if build-diann fails
  • sync-openms (line 254) can publish even if build-diann or build-relink fails

If the intent is only to tolerate skipped predecessors, key the condition off needs.<job>.result being success or skipped instead.

Suggested fix
-    if: always() && needs.detect-changes.outputs.has_relink == 'true' && github.repository_owner == 'bigbio'
+    if: needs.detect-changes.outputs.has_relink == 'true'
+      && github.repository_owner == 'bigbio'
+      && contains(fromJSON('["success","skipped"]'), needs.build-diann.result)
-    if: always() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && github.repository_owner == 'bigbio'
+    if: (github.event_name == 'release' || github.event_name == 'workflow_dispatch')
+      && github.repository_owner == 'bigbio'
+      && contains(fromJSON('["success","skipped"]'), needs.build-diann.result)
+      && contains(fromJSON('["success","skipped"]'), needs.build-relink.result)

Also applies to: 254-254

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/quantms-containers.yml at line 196, The condition using
always() allows downstream jobs to run even when predecessors failed; change the
if expressions for the build-relink job (which currently checks always() &&
needs.detect-changes.outputs.has_relink == 'true' && github.repository_owner ==
'bigbio') to instead require that the predecessor(s) succeeded or were skipped,
e.g. check needs.build-diann.result == 'success' || needs.build-diann.result ==
'skipped' (and/or needs.detect-changes.result similarly) combined with
needs.detect-changes.outputs.has_relink == 'true' and github.repository_owner ==
'bigbio'; do the same for the sync-openms job so it only publishes when prior
jobs like build-diann and build-relink have result == 'success' or 'skipped'
rather than using always().

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.

4 participants