Skip to content

Commit e3fa635

Browse files
committed
fix: encapsulate draft releases into public updates
1 parent 6543b77 commit e3fa635

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

.github/agents/dev-relations.agent.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ These inform how you frame changes. A new analyzer is not just "a new analyzer"
2121
<workflow>
2222
Follow these steps in order:
2323

24-
1. **Identify the last two tags.** Run `git tag --sort=-v:refname | head -2`.
25-
2. **Gather raw changes.** Run `git log <old-tag>..<new-tag> --oneline` and read the corresponding section of `/CHANGELOG.md`.
26-
3. **Inspect changes by area.** Run `git diff <old-tag>..<new-tag> --stat` to see which files changed. When a commit message is unclear, read the actual diff or changed files to understand what happened.
24+
1. **Determine the tag range.** The prompt may specify a base tag and a head tag (e.g., "base: v0.1.35, head: v0.1.38"). If provided, use those directly. Otherwise, identify the latest tag with `git tag --sort=-v:refname | head -1` as the head, and the second-latest with `head -2 | tail -1` as the base.
25+
2. **Gather raw changes.** Run `git log <base-tag>..<head-tag> --oneline` and read all corresponding sections of `/CHANGELOG.md` that fall within the range — there may be multiple version entries if several releases occurred since the last published release.
26+
3. **Inspect changes by area.** Run `git diff <base-tag>..<head-tag> --stat` to see which files changed. When a commit message is unclear, read the actual diff or changed files to understand what happened.
2727
4. **Identify the topology.** Determine the single most impactful user-facing change — the headline. Everything else in the release either supports that headline (examples demonstrating it, docs explaining it) or is independent. This topology drives the structure of the summary.
2828
5. **Categorize changes** using these rules:
2929
- `src/` — Library changes. Frame as user-facing improvements: new capabilities, better error messages, stability gains. Connect to Flowthru's core promises where natural.

.github/workflows/release.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,30 @@ jobs:
147147
if: steps.release.outputs.changed == 'true'
148148
run: npm install -g @github/copilot
149149

150+
- name: Determine last published release tag
151+
if: steps.release.outputs.changed == 'true'
152+
id: last-published
153+
env:
154+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155+
run: |
156+
# Find the most recent non-draft, non-prerelease published release tag
157+
BASE_TAG=$(gh release list --limit 20 --json tagName,isDraft,isPrerelease \
158+
--jq '[.[] | select(.isDraft == false and .isPrerelease == false)] | .[0].tagName // empty')
159+
if [ -z "$BASE_TAG" ]; then
160+
# Fallback: second-latest git tag if no published release exists
161+
BASE_TAG=$(git tag --sort=-v:refname | head -2 | tail -1)
162+
fi
163+
echo "tag=${BASE_TAG}" >> $GITHUB_OUTPUT
164+
echo "Base tag for release summary: ${BASE_TAG}"
165+
150166
- name: Generate release summary
151167
if: steps.release.outputs.changed == 'true'
152168
env:
153169
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }}
154170
run: |
155-
copilot -p "Generate a release summary for the latest release." \
171+
HEAD_TAG="v${{ steps.release.outputs.version }}"
172+
BASE_TAG="${{ steps.last-published.outputs.tag }}"
173+
copilot -p "Generate a release summary. Base tag: ${BASE_TAG}, head tag: ${HEAD_TAG}. Summarize all changes between these two tags." \
156174
--agent=dev-relations \
157175
--available-tools='view,create,bash' \
158176
--allow-tool='shell(git:*)' \

0 commit comments

Comments
 (0)