Skip to content

fix(ci): restore GHCR workflow startup - #1715

Merged
POWERFULMOVES merged 1 commit into
mainfrom
codex/fix-attest-provenance-sha
Jun 5, 2026
Merged

POWERFULMOVES merged 1 commit into
mainfrom
codex/fix-attest-provenance-sha

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • restore GHCR workflow startup under selected-actions + SHA-pinning policy
  • switch GitHub App token generation to current v3 app-id input and make it best-effort behind configured GH_APP_ID/GH_APP_SEC
  • replace disallowed anchore/sbom-action/download-syft sub-action with direct Syft release install

Validation

  • python YAML parse for integrations-ghcr.yml
  • actionlint integrations-ghcr.yml
  • git diff --check
  • GHCR PR run 27020168120: success (15 successful jobs, 2 expected skipped)

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The workflow is updated to migrate GitHub App authentication from GH_APP_CLIENT_ID/GH_APP_SEC to GH_APP_ID/GH_APP_SEC across environment setup, secrets validation, token generation, and error messaging. Additionally, the Syft SBOM tool is now installed inline as a pinned v1.45.0 binary instead of sourced through an external action.

Changes

GHCR Integration Workflow Updates

Layer / File(s) Summary
GitHub App credential migration
.github/workflows/integrations-ghcr.yml
Workflow environment now pulls GH_APP_ID and GH_APP_SEC from secrets; secrets validation audits the new variable names; GitHub App token generation step is conditionally enabled and wired using the updated credentials; error messaging updated to reference GH_APP_ID/GH_APP_SEC.
Syft inline installation
.github/workflows/integrations-ghcr.yml
Syft download action replaced with inline bash script that pins v1.45.0, downloads the amd64 release, extracts and installs the binary to /usr/local/bin/syft, and validates the installation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • POWERFULMOVES/PMOVES.AI#1252: Both PRs modify .github/workflows/integrations-ghcr.yml in the same areas—GitHub App token generation credential wiring (GH_APP_ID/GH_APP_SEC) and the SBOM/Syft tooling step.
  • POWERFULMOVES/PMOVES.AI#854: Both PRs modify .github/workflows/integrations-ghcr.yml to use GH_APP_ID/GH_APP_SEC GitHub App credential wiring.
  • POWERFULMOVES/PMOVES.AI#1657: Both PRs modify the GHCR integration workflow's SBOM/Syft generation logic in .github/workflows/integrations-ghcr.yml.

Poem

🐰 Credentials now flow with clarity bright,
Old names retire—let new ones take flight!
Syft's anchored in stone, a version so true,
Workflows march onward, refreshed and brand new. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description includes a Summary section and detailed testing validation, but is missing the required Testing section with specific command documentation and lacks the Required Checks checklist. Restructure to follow the template by adding a proper Testing section with command documentation and include the Required Checks checklist, even if some items don't apply.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'fix(ci): restore GHCR workflow startup' accurately reflects the main objective of the PR, which is to restore the GHCR workflow startup that was failing due to SHA-pinning issues.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-attest-provenance-sha

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: feba57d9d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/attest-provenance.yml Outdated
steps:
- name: Attest build provenance
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4
uses: actions/attest-build-provenance@b3e506e8c389afc651c5bacf2b8f2a1ea0557215 # v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore the v4 attest action SHA

This SHA does not correspond to the actions/attest-build-provenance v4 tag; I checked the upstream tag/release listing and both v4/v4.1.0 point at a2bbfa2, while this replacement uses b3e506e.... In any workflow run that reaches this step, GitHub will attempt to resolve actions/attest-build-provenance@b3e506e... and fail before provenance is generated; the same bad ref was applied in build-images.yml and integrations-ghcr.yml as well.

Useful? React with 👍 / 👎.

@POWERFULMOVES
POWERFULMOVES force-pushed the codex/fix-attest-provenance-sha branch 7 times, most recently from 613014c to ae52cea Compare June 5, 2026 14:16

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/integrations-ghcr.yml:
- Around line 447-455: Replace the incorrect PEM value being passed into
actions/create-github-app-token: change the `private-key: ${{ env.GH_APP_SEC }}`
input to use the repository secret PEM `private-key: ${{
secrets.GH_APP_PRIVATE_KEY }}` while keeping `app-id: ${{ env.GH_APP_ID }}` and
leaving `GH_APP_SEC` as the OAuth client secret elsewhere; also scan other
workflow files for the same misuse of `GH_APP_SEC` and switch those to
`secrets.GH_APP_PRIVATE_KEY` where a PEM private key is required.
- Around line 677-688: The workflow step "Install Syft (SBOM)" currently
downloads and installs Syft without integrity checks and pins a non-existent
SYFT_VERSION; update SYFT_VERSION to a real release (e.g., v1.44.0) and add a
SYFT_SHA256 variable (or fetch the official checksum file) then verify the
downloaded tarball before extracting and installing: after curl, run a SHA256
verification (e.g., compare SYFT_SHA256 with the downloaded tarball via
sha256sum -c or echo "<SHA>  <file>" | sha256sum -c -) and fail the job if the
checksum does not match, only then proceed to tar -xzf and sudo install the syft
binary; ensure the environment variable names SYFT_VERSION and SYFT_SHA256 and
the actions around curl, tar, and sudo install are updated 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4d871e38-56e4-4596-8577-1030d92f4e7f

📥 Commits

Reviewing files that changed from the base of the PR and between a7597cd and ae52cea.

📒 Files selected for processing (1)
  • .github/workflows/integrations-ghcr.yml

Comment on lines +447 to 455
if: ${{ env.GH_APP_ID != '' && env.GH_APP_SEC != '' }}
continue-on-error: true
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
client-id: ${{ secrets.GH_APP_CLIENT_ID }}
private-key: ${{ secrets.GH_APP_SEC }}
app-id: ${{ env.GH_APP_ID }}
private-key: ${{ env.GH_APP_SEC }}
# Explicit token scopes required for clone + GHCR push
permission-contents: read
permission-packages: write

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if audit script would flag this workflow's private-key usage
rg -n 'private-key:.*GH_APP_SEC' .github/workflows/

# Verify canonical documentation states
fd -t f 'CANONICAL_NAMES.md' --exec cat {}

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 12998


Fix GitHub App token private-key to use PEM secret GH_APP_PRIVATE_KEY

.github/workflows/integrations-ghcr.yml passes private-key: ${{ env.GH_APP_SEC }} into actions/create-github-app-token. Repo canonical naming states GH_APP_SEC is the OAuth client secret (NOT a PEM), while private-key must be the PEM secret GH_APP_PRIVATE_KEY (-----BEGIN RSA PRIVATE KEY-----). The same misuse pattern still exists in other workflows.

  • Update this workflow to use secrets.GH_APP_PRIVATE_KEY for private-key (and keep GH_APP_SEC only for the OAuth client secret).
  • Location: .github/workflows/integrations-ghcr.yml (~lines 447-455)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/integrations-ghcr.yml around lines 447 - 455, Replace the
incorrect PEM value being passed into actions/create-github-app-token: change
the `private-key: ${{ env.GH_APP_SEC }}` input to use the repository secret PEM
`private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}` while keeping `app-id: ${{
env.GH_APP_ID }}` and leaving `GH_APP_SEC` as the OAuth client secret elsewhere;
also scan other workflow files for the same misuse of `GH_APP_SEC` and switch
those to `secrets.GH_APP_PRIVATE_KEY` where a PEM private key is required.

Comment on lines 677 to +688
- name: Install Syft (SBOM)
if: ${{ steps.cfg.outputs.generate_sbom == 'true' && steps.meta.outputs.has_tags == 'true' }}
uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610
env:
SYFT_VERSION: v1.45.0
run: |
set -euo pipefail
install_dir="${RUNNER_TEMP}/syft-bin"
mkdir -p "$install_dir"
curl -sSfL "https://github.com/anchore/syft/releases/download/${SYFT_VERSION}/syft_${SYFT_VERSION#v}_linux_amd64.tar.gz" -o "${RUNNER_TEMP}/syft.tar.gz"
tar -xzf "${RUNNER_TEMP}/syft.tar.gz" -C "$install_dir" syft
sudo install -m 0755 "${install_dir}/syft" /usr/local/bin/syft
syft version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the SHA256 checksum for syft 1.45.0 linux amd64?

💡 Result:

As of June 5, 2026, there is no official release for Syft version 1.45.0 in the anchore/syft GitHub repository. The latest available release at that time was v1.44.0 [1][2]. While references to version 1.45.0 appear in external project pipelines [3], an official release page with corresponding checksums for Syft 1.45.0 was not found. [1][4]. For official checksums, always refer directly to the Anchore Syft GitHub release page for the specific version [4].

Citations:


Add integrity verification for the Syft download (and fix SYFT_VERSION)

In .github/workflows/integrations-ghcr.yml (Install Syft (SBOM)), the workflow downloads and sudo installs the Syft binary without any checksum/signature verification. Also, SYFT_VERSION: v1.45.0 does not appear to have an official anchore/syft GitHub release/checksums (latest available release found was v1.44.0), so a correct SYFT_SHA256 can’t be sourced for that pinned artifact. Bump to an existing tagged version and verify the downloaded tarball against the official SHA256 checksums before extracting/installing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/integrations-ghcr.yml around lines 677 - 688, The workflow
step "Install Syft (SBOM)" currently downloads and installs Syft without
integrity checks and pins a non-existent SYFT_VERSION; update SYFT_VERSION to a
real release (e.g., v1.44.0) and add a SYFT_SHA256 variable (or fetch the
official checksum file) then verify the downloaded tarball before extracting and
installing: after curl, run a SHA256 verification (e.g., compare SYFT_SHA256
with the downloaded tarball via sha256sum -c or echo "<SHA>  <file>" | sha256sum
-c -) and fail the job if the checksum does not match, only then proceed to tar
-xzf and sudo install the syft binary; ensure the environment variable names
SYFT_VERSION and SYFT_SHA256 and the actions around curl, tar, and sudo install
are updated accordingly.

@POWERFULMOVES POWERFULMOVES changed the title fix(ci): correct attest provenance action sha fix(ci): restore GHCR workflow startup Jun 5, 2026
@POWERFULMOVES
POWERFULMOVES merged commit 408c672 into main Jun 5, 2026
33 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the codex/fix-attest-provenance-sha branch June 5, 2026 14:28
POWERFULMOVES added a commit that referenced this pull request Jun 5, 2026
…weep /tmp SBOM scratch (#1717)

#1715 restored the GHCR workflow startup (pinned attest-build-provenance) and added a
`cleanup-self-hosted-runners` job, but introduced two issues:

1. Deadlock: the cleanup matrix `[kvm4, kvm2]` references a `kvm2` runner label that
   does not exist (both VPS runners are labelled `kvm4`). Because `build-publish`
   `needs: cleanup-self-hosted-runners`, the unschedulable `kvm2` leg leaves the job
   permanently queued and blocks every push-triggered publish (run 27020807888).
   Fix: matrix -> `[kvm4]`.

2. Blind spot: the cleanup prunes Docker + `_work`, but the 2026-06-05 KVM4-1 disk-full
   incident was 126G of orphaned Syft/stereoscope SBOM extractions in `/tmp` — invisible
   to `docker system prune`. Add an explicit `/tmp` sweep of stereoscope-*/sbom-action-*/
   codeql-* older than a day (active scans are minutes old, untouched).

Complements the node-side /etc/tmpfiles.d aging rule placed on KVM4-1.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.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.

2 participants