Skip to content

chore(upstream-sync): improve workflow and prompt handling - #12

Merged
Mearman merged 5 commits into
mainfrom
chore/upstream-sync-improvements
Feb 16, 2026
Merged

Mearman merged 5 commits into
mainfrom
chore/upstream-sync-improvements

Conversation

@Mearman

@Mearman Mearman commented Feb 16, 2026

Copy link
Copy Markdown
Member

Moves the upstream-sync workflow's inline prompt into .github/prompts/upstream-sync/01-sync-task.md and changes the workflow to invoke the composite action wrapper (uses: ./) with prompt_dir: upstream-sync.

This refactoring improves maintainability by separating prompt logic from workflow configuration, following the same pattern used for interactive and review modes.

Add Bash permissions for cat, sort, comm, diff, echo, and grep so the
sync agent can run comparison scripts against upstream inputs/outputs.
Move the inline prompt from the upstream-sync workflow into
.github/prompts/upstream-sync/01-sync-task.md so it can be composed
via the action's prompt_dir mechanism. Includes tool-use issue
reporting instructions.
Replace uses: anthropics/claude-code-action@v1 with uses: ./ so the
upstream-sync workflow eats our own dogfood like the other workflows.
Prompt is now composed from .github/prompts/upstream-sync/ via
prompt_dir. Also adds Bash(date:*) to allowed tools and removes the
pre-computed sync_date output.
Clarify the distinction between the rolling v1 tag and the actual patch
version, and link to individual releases and the releases page.

@claude claude 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.

Refactoring the upstream-sync workflow to use prompt files improves maintainability. Found a few issues to consider before merging.

## After making changes

If you made any meaningful changes:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The prompt instructs the agent to compute date +%Y%m%d at runtime, but the workflow previously pre-computed this value in steps.fetch.outputs.sync_date. Now that the workflow no longer provides this value, the agent must compute it during execution.

This works, but it introduces a race condition: if the workflow starts just before midnight and the agent runs just after, the branch name won't match what was intended. The previous approach (pre-computing in the workflow) was more deterministic.

Consider either:

  1. Restoring the pre-computed date in the workflow, or
  2. Documenting this edge case in the prompt

## Upstream reference

From release.json, extract the latest patch version tag (e.g. v1.0.52)
and its published date. Note: the v1 tag is a rolling tag that tracks

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instructions reference release.json to extract "the latest patch version tag (e.g. v1.0.52)" and explain that "the v1 tag is a rolling tag that tracks the latest patch release."

However, the instructions don't specify which field(s) in release.json to extract (e.g., .tag_name, .name, .published_at). The agent may need to read the file structure first or make assumptions about the schema.

- name: Run Claude Code for sync analysis
if: steps.guard.outputs.skip != 'true'
uses: anthropics/claude-code-action@v1
uses: ./

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

uses: ./ invokes the composite action from the current repository instead of calling upstream directly.

This changes the behavior significantly:

  • Previous: called anthropics/claude-code-action@v1 directly with an inline prompt
  • Now: calls the wrapper action with prompt_dir: upstream-sync

The wrapper action's prompt composition step (action.yml:176-232) will look for prompts in .github/prompts/upstream-sync/*.md relative to the action path (${{ github.action_path }}), which when uses: ./ is specified, points to the repo root.

Verify that the prompt composition correctly resolves .github/prompts/upstream-sync/01-sync-task.md when invoked this way.

do nothing — no branch, no commit, no PR. Just state that everything is
in sync.
prompt_dir: upstream-sync
claude_args: >-

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The allowed tools list adds several bash commands (cat, sort, comm, diff, echo, grep, date), but the prompt instructs the agent to avoid these in favor of specialized tools.

From CLAUDE.md prompts:

"Avoid using Bash with the find, grep, cat, head, tail, sed, awk, or echo commands... Instead, always prefer using the dedicated tools"

The upstream-sync prompt doesn't override this guidance. Consider whether these bash commands are actually needed for the sync task, or if the agent can use Read, Grep, etc. instead.

Use .tag_name and .published_at explicitly so the agent doesn't need
to inspect the schema.
@Mearman
Mearman merged commit 29eb92d into main Feb 16, 2026
2 checks passed
@Mearman
Mearman deleted the chore/upstream-sync-improvements branch February 16, 2026 15:37
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.

1 participant