Skip to content

fix: replace SHA in comment example with @VERSION placeholder#118

Merged
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:fix/comment-sha-placeholder
Mar 26, 2026
Merged

fix: replace SHA in comment example with @VERSION placeholder#118
derekmisler merged 1 commit intodocker:mainfrom
derekmisler:fix/comment-sha-placeholder

Conversation

@derekmisler
Copy link
Copy Markdown
Contributor

Problem

The release workflow (release.yml) was failing at the "Create release commit with pinned refs" step.

Line 15 of .github/workflows/review-pr.yml is a YAML comment that serves as a documentation example:

#       uses: docker/cagent-action/.github/workflows/review-pr.yml@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1

Although the sed replacement is comment-aware (anchored on uses:) and correctly skips this line, the verification grep (OLD_PIN_PATTERN) is not — it matched the SHA in the comment and reported it as a stale ref, causing the step to exit with an error.

Fix

Replace the real SHA in the comment with a plain @VERSION placeholder. This is a documentation example; it does not need a real SHA.

#       uses: docker/cagent-action/.github/workflows/review-pr.yml@VERSION

Why this works:

  • @VERSION contains no 40-character hex string, so it never matches @[a-f0-9]{40}
  • Neither the update-self-refs sed nor the verification grep will ever touch it again
  • The change is strictly minimal — one comment line, nothing else

Testing

After this merge, a release workflow run will find exactly the three real uses: lines (lines 231, 353, 696) and successfully pin + verify them without hitting the false-positive on line 15.

@derekmisler derekmisler requested a review from a team as a code owner March 26, 2026 16:17
@derekmisler derekmisler self-assigned this Mar 26, 2026
Copy link
Copy Markdown
Contributor

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

This PR fixes a false-positive in the release workflow verification by replacing a real SHA in a documentation comment with a @VERSION placeholder.

Analysis:

  • The change is in a YAML comment (line 15) that serves as a usage example
  • The actual workflow code continues to use properly pinned SHA references
  • No functional code is modified
  • The @VERSION placeholder prevents the verification grep from matching this comment line

Verdict: No bugs detected. This is a safe documentation-only change that resolves the release workflow issue.

The SHA+version-comment on line 15 was a documentation example inside a
YAML comment block. The release workflow's OLD_PIN_PATTERN grep matched it
as a stale ref, causing the 'Create release commit with pinned refs' step to
fail at the verification stage.

Replacing the real SHA with '@Version' means it no longer matches
'@[a-f0-9]{40}', so neither the update-self-refs sed nor the verification
grep will ever touch it again.

This also replaces all SHA-pinned refs in markdown documentation files
(README.md, review-pr/README.md, security/README.md) with '@Version' so
the update-self-refs job's markdown sed pass never matches them again.
Accordingly, the MD_PIN_PATTERN definition and its while loop have been
removed from release.yml's update-self-refs job — they will never match
anything and are dead code.

Assisted-By: docker-agent
@derekmisler derekmisler force-pushed the fix/comment-sha-placeholder branch from 6a2630d to fce1429 Compare March 26, 2026 16:21
@derekmisler derekmisler enabled auto-merge (squash) March 26, 2026 16:27
@derekmisler derekmisler merged commit f954a4b into docker:main Mar 26, 2026
8 checks passed
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