testing ghcr login#198
Conversation
WalkthroughGitHub Actions workflows in both build and publish jobs update their GHCR container login steps to use GitHub actor identity and GITHUB_TOKEN instead of separate GHCR credentials. The build workflow includes a temporary comment flagging that PR auth testing should be reverted before merge. ChangesGHCR Authentication Credential Migration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/build.yml:
- Around line 40-44: Re-enable the pull_request guard so GHCR auth only runs for
non-PR workflows: restore the conditional (if: ${{ !
startsWith(github.event_name, 'pull_request') }}) above the GHCR auth block that
contains the "with: registry: ghcr.io username: ${{ github.actor }} password:
${{ secrets.GITHUB_TOKEN }}" settings, ensuring the job no longer requests GHCR
authentication on PR runs (leave existing push: false / push: ${{ !
startsWith(github.event_name, 'pull_request') }} behavior unchanged).
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0a5deec0-0745-4ef9-a2b3-535911f9ff69
📒 Files selected for processing (2)
.github/workflows/build.yml.github/workflows/publish.yml
| # if: ${{ ! startsWith(github.event_name, 'pull_request') }} # TEMP: enable on PRs to test GHCR auth — REVERT BEFORE MERGE | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ secrets.GHCR_USER }} | ||
| password: ${{ secrets.PACKAGE_SCOPE }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== build.yml: login step and push behavior =="
sed -n '38,105p' .github/workflows/build.yml
echo
echo "Expected:"
echo "- Login to GHCR has no if-guard today"
echo "- Build Container Image uses push: false"
echo "- Push Image is still disabled on pull_request"Repository: SpecterOps/AzureHound
Length of output: 3337
Restore the PR guard before merging.
Line 40 drops the only pull_request guard, but this job never pushes images on PRs (see push: false on Line 83 and push: ${{ ! startsWith(github.event_name, 'pull_request') }} on Line 102). PR runs execute unnecessary GHCR authentication while the job still requests packages: write.
Suggested fix
- # if: ${{ ! startsWith(github.event_name, 'pull_request') }} # TEMP: enable on PRs to test GHCR auth — REVERT BEFORE MERGE
+ if: ${{ ! startsWith(github.event_name, 'pull_request') }}📝 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.
| # if: ${{ ! startsWith(github.event_name, 'pull_request') }} # TEMP: enable on PRs to test GHCR auth — REVERT BEFORE MERGE | |
| with: | |
| registry: ghcr.io | |
| username: ${{ secrets.GHCR_USER }} | |
| password: ${{ secrets.PACKAGE_SCOPE }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| if: ${{ ! startsWith(github.event_name, 'pull_request') }} | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} |
🤖 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/build.yml around lines 40 - 44, Re-enable the pull_request
guard so GHCR auth only runs for non-PR workflows: restore the conditional (if:
${{ ! startsWith(github.event_name, 'pull_request') }}) above the GHCR auth
block that contains the "with: registry: ghcr.io username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}" settings, ensuring the job no longer
requests GHCR authentication on PR runs (leave existing push: false / push: ${{
! startsWith(github.event_name, 'pull_request') }} behavior unchanged).
test branch
Summary by CodeRabbit