Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions .github/workflows/blog-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
publish:
Expand Down Expand Up @@ -52,6 +53,7 @@ jobs:
echo "Publishing: $ARTICLE"

- name: Publish article
id: publish
if: steps.resolve.outputs.article != ''
env:
ARTICLE: ${{ steps.resolve.outputs.article }}
Expand All @@ -69,16 +71,38 @@ jobs:
exit 1
fi

# Commit and push
# Commit to a publish branch
SLUG=$(basename "$ARTICLE" .md)
SLUG=$(basename "$SLUG" .mdx)
BRANCH="blog/publish-${SLUG}"

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b "$BRANCH"
git add "$ARTICLE"

TITLE=$(grep '^title:' "$ARTICLE" | head -1 | sed 's/title: *//; s/^"//; s/"$//')
printf 'blog: publish — %s\n' "$TITLE" > /tmp/commit-msg.txt
git commit -F /tmp/commit-msg.txt
git push origin develop
git push origin "$BRANCH"

SLUG=$(basename "$ARTICLE" .md)
SLUG=$(basename "$SLUG" .mdx)
echo "slug=$SLUG" >> $GITHUB_OUTPUT
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
echo "title=$TITLE" >> $GITHUB_OUTPUT

- name: Create and merge PR
if: steps.resolve.outputs.article != ''
Comment on lines +93 to +94
Copy link

Choose a reason for hiding this comment

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

"Create and merge PR" runs when "Publish article" exited early

When the "Publish article" step hits the early-exit path (exit 0 for an already-published article), it exits successfully but never sets steps.publish.outputs.branch, steps.publish.outputs.slug, or steps.publish.outputs.title. The "Create and merge PR" step only checks steps.resolve.outputs.article != '', which is still truthy, so it proceeds with empty env vars. This causes gh pr create --head "" to fail ungracefully.

The condition should also gate on steps.publish.outputs.branch != '':

Suggested change
- name: Create and merge PR
if: steps.resolve.outputs.article != ''
- name: Create and merge PR
if: steps.resolve.outputs.article != '' && steps.publish.outputs.branch != ''
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/blog-publish.yml
Line: 93-94

Comment:
**"Create and merge PR" runs when "Publish article" exited early**

When the "Publish article" step hits the early-exit path (`exit 0` for an already-published article), it exits successfully but **never sets** `steps.publish.outputs.branch`, `steps.publish.outputs.slug`, or `steps.publish.outputs.title`. The "Create and merge PR" step only checks `steps.resolve.outputs.article != ''`, which is still truthy, so it proceeds with empty env vars. This causes `gh pr create --head ""` to fail ungracefully.

The condition should also gate on `steps.publish.outputs.branch != ''`:

```suggestion
      - name: Create and merge PR
        if: steps.resolve.outputs.article != '' && steps.publish.outputs.branch != ''
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLUG: ${{ steps.publish.outputs.slug }}
BRANCH: ${{ steps.publish.outputs.branch }}
TITLE: ${{ steps.publish.outputs.title }}
run: |
PR_URL=$(gh pr create \
--base develop \
--head "$BRANCH" \
--title "blog: publish — $TITLE" \
--body "Auto-publish article: \`$SLUG\`")
echo "Created PR: $PR_URL"
gh pr merge "$PR_URL" --squash --admin --delete-branch
echo "Published: https://tryethernal.com/blog/$SLUG"
18 changes: 18 additions & 0 deletions blog/pipeline/draft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ fi

log "Phase 3 complete."

# ============================================================
# Validate: Astro build must pass before committing
# ============================================================
log "Validating blog build..."
cd "$REPO_DIR/blog"
if ! npx astro build 2>&1 | tee -a "$LOG_FILE"; then
log "ERROR: Astro build failed — article has schema or syntax errors"
cd "$REPO_DIR/blog/pipeline"
CARD_ID="$CARD_ID" node --input-type=module -e "
import { updateCardStatus } from './project.js';
updateCardStatus(process.env.CARD_ID, 'detected');
console.log('Card reset to Detected');
" 2>&1 | tee -a "$LOG_FILE"
exit 1
fi
cd "$REPO_DIR"
log "Build validation passed."

# ============================================================
# Commit, push, and update card
# ============================================================
Expand Down
2 changes: 1 addition & 1 deletion blog/pipeline/prompts/2-draft.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Save the article to `blog/src/content/blog/<slug>.md` with this frontmatter:
```yaml
---
title: "Article Title"
description: "110-160 chars max."
description: "110-160 chars max. MUST be ≤160 characters (Zod schema in src/content.config.ts enforces this; build will fail if exceeded)."
date: YYYY-MM-DD
tags:
- Tag1
Expand Down
2 changes: 1 addition & 1 deletion blog/src/content/blog/the-commerce-layer-erc-8183.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "The Commerce Layer: How ERC-8183 Makes AI Agent Payments Verifiable"
description: "ERC-8183 adds the missing verb to agent commerce: not 'I sent you value' but 'I will pay you when you deliver.' Here's how the job lifecycle and evaluator model work."
description: "ERC-8183 adds the missing verb to agent commerce: not 'I sent value' but 'I will pay when you deliver.' How the job lifecycle and evaluator work."
date: 2026-03-12
tags:
- AI Agents
Expand Down
Loading