Skip to content

Commit fce1429

Browse files
committed
fix: replace SHA in comment example with @Version placeholder
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
1 parent adf7f89 commit fce1429

File tree

5 files changed

+19
-30
lines changed

5 files changed

+19
-30
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ jobs:
368368
OLD_PATTERN='docker/cagent-action[^@]*@[a-f0-9]\{40\} # v[^ ]*'
369369
# YAML sed: anchored on `uses:` to avoid false matches in comments
370370
YAML_PIN_PATTERN='s|\(uses: *docker/cagent-action\)\([^@]*\)@[a-f0-9]\{40\} # v[^ ]*|\1\2@'"${SHA}"' # '"${VERSION}"'|g'
371-
# Markdown sed: anchored on `docker/cagent-action` directly (no `uses:` prefix in code blocks)
372-
MD_PIN_PATTERN='s|\(docker/cagent-action\)\([^@]*\)@[a-f0-9]\{40\} # v[^ ]*|\1\2@'"${SHA}"' # '"${VERSION}"'|g'
373371
374372
UPDATED_FILES=()
375373
@@ -382,15 +380,6 @@ jobs:
382380
--exclude-dir=.git \
383381
review-pr/ .github/workflows/review-pr.yml .github/workflows/release.yml)
384382
385-
# Update Markdown files (broader pattern, no uses: anchor)
386-
while IFS= read -r file; do
387-
sed -i "$MD_PIN_PATTERN" "$file"
388-
UPDATED_FILES+=("$file")
389-
echo " Updated (md): $file"
390-
done < <(grep -rl "$OLD_PATTERN" --include='*.md' \
391-
--exclude-dir=.git \
392-
.)
393-
394383
if [ ${#UPDATED_FILES[@]} -eq 0 ]; then
395384
echo "No self-refs needed updating, skipping."
396385
echo "skip=true" >> "$GITHUB_OUTPUT"

.github/workflows/review-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
# jobs:
1414
# review:
15-
# uses: docker/cagent-action/.github/workflows/review-pr.yml@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
15+
# uses: docker/cagent-action/.github/workflows/review-pr.yml@VERSION
1616
# # Scoped to the job so other jobs in this workflow aren't over-permissioned
1717
# permissions:
1818
# contents: read # Read repository files and PR diffs

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A GitHub Action for running [Docker Agent](https://github.com/docker/docker-agen
77
1. **Add the action to your workflow**:
88

99
```yaml
10-
- uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
10+
- uses: docker/cagent-action@VERSION
1111
with:
1212
agent: path/to/agent.yaml
1313
prompt: "Analyze this code"
@@ -62,7 +62,7 @@ permissions:
6262

6363
jobs:
6464
review:
65-
uses: docker/cagent-action/.github/workflows/review-pr.yml@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
65+
uses: docker/cagent-action/.github/workflows/review-pr.yml@VERSION
6666
# Scoped to the job so other jobs in this workflow aren't over-permissioned
6767
permissions:
6868
contents: read # Read repository files and PR diffs
@@ -84,7 +84,7 @@ See the [full PR Review documentation](review-pr/README.md) for more details.
8484

8585
```yaml
8686
- name: Run Custom Agent
87-
uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
87+
uses: docker/cagent-action@VERSION
8888
with:
8989
agent: ./agents/my-agent.yaml
9090
prompt: "Analyze the codebase"
@@ -95,7 +95,7 @@ See the [full PR Review documentation](review-pr/README.md) for more details.
9595

9696
```yaml
9797
- name: Run Docker Agent with Custom Settings
98-
uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
98+
uses: docker/cagent-action@VERSION
9999
with:
100100
agent: docker/code-analyzer
101101
prompt: "Analyze this codebase"
@@ -115,7 +115,7 @@ See the [full PR Review documentation](review-pr/README.md) for more details.
115115
```yaml
116116
- name: Run Docker Agent
117117
id: agent
118-
uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
118+
uses: docker/cagent-action@VERSION
119119
with:
120120
agent: docker/code-analyzer
121121
prompt: "Analyze this codebase"
@@ -245,14 +245,14 @@ jobs:
245245
- uses: actions/checkout@v4
246246
247247
- name: Security Review
248-
uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
248+
uses: docker/cagent-action@VERSION
249249
with:
250250
agent: docker/github-action-security-scanner
251251
prompt: "Analyze for security issues"
252252
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
253253
254254
- name: Code Quality Analysis
255-
uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
255+
uses: docker/cagent-action@VERSION
256256
with:
257257
agent: docker/code-quality-analyzer
258258
prompt: "Analyze code quality and best practices"
@@ -285,7 +285,7 @@ jobs:
285285
- uses: actions/checkout@v4
286286
287287
- name: Run Agent
288-
uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
288+
uses: docker/cagent-action@VERSION
289289
with:
290290
agent: ${{ github.event.inputs.agent }}
291291
prompt: ${{ github.event.inputs.prompt }}

review-pr/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ permissions:
2323

2424
jobs:
2525
review:
26-
uses: docker/cagent-action/.github/workflows/review-pr.yml@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
26+
uses: docker/cagent-action/.github/workflows/review-pr.yml@VERSION
2727
# Scoped to the job so other jobs in this workflow aren't over-permissioned
2828
permissions:
2929
contents: read # Read repository files and PR diffs
@@ -146,7 +146,7 @@ jobs:
146146
fetch-depth: 0
147147
ref: refs/pull/${{ github.event.issue.number }}/head
148148
149-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
149+
- uses: docker/cagent-action/review-pr@VERSION
150150
with:
151151
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
152152
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -163,7 +163,7 @@ The recommended approach is to add an `AGENTS.md` file to your repository root.
163163
For workflow-level overrides or guidelines that apply across multiple repos, use the `additional-prompt` input:
164164

165165
```yaml
166-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
166+
- uses: docker/cagent-action/review-pr@VERSION
167167
with:
168168
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
169169
additional-prompt: |
@@ -174,7 +174,7 @@ For workflow-level overrides or guidelines that apply across multiple repos, use
174174
```
175175
176176
```yaml
177-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
177+
- uses: docker/cagent-action/review-pr@VERSION
178178
with:
179179
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
180180
additional-prompt: |
@@ -186,7 +186,7 @@ For workflow-level overrides or guidelines that apply across multiple repos, use
186186
187187
```yaml
188188
# Project-specific conventions
189-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
189+
- uses: docker/cagent-action/review-pr@VERSION
190190
with:
191191
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
192192
additional-prompt: |
@@ -207,31 +207,31 @@ Override for more thorough or cost-effective reviews:
207207

208208
```yaml
209209
# Anthropic (default provider)
210-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
210+
- uses: docker/cagent-action/review-pr@VERSION
211211
with:
212212
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
213213
model: anthropic/claude-opus-4 # More thorough reviews
214214
```
215215

216216
```yaml
217217
# OpenAI Codex
218-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
218+
- uses: docker/cagent-action/review-pr@VERSION
219219
with:
220220
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
221221
model: openai/codex-mini
222222
```
223223

224224
```yaml
225225
# Google Gemini
226-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
226+
- uses: docker/cagent-action/review-pr@VERSION
227227
with:
228228
google-api-key: ${{ secrets.GOOGLE_API_KEY }}
229229
model: gemini/gemini-2.0-flash
230230
```
231231

232232
```yaml
233233
# xAI Grok
234-
- uses: docker/cagent-action/review-pr@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
234+
- uses: docker/cagent-action/review-pr@VERSION
235235
with:
236236
xai-api-key: ${{ secrets.XAI_API_KEY }}
237237
model: xai/grok-2

security/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ All tests must pass before deployment.
220220
```yaml
221221
- name: Run Agent
222222
id: agent
223-
uses: docker/cagent-action@dba0ca51938c78afb363625363c50582243218d6 # v1.3.1
223+
uses: docker/cagent-action@VERSION
224224
with:
225225
agent: my-agent
226226
prompt: "Analyze the logs"

0 commit comments

Comments
 (0)