From 3b1a0a6438852ec3b61a52558534ae924ad91b52 Mon Sep 17 00:00:00 2001 From: kitsuyui Date: Thu, 11 Jun 2026 23:26:35 +0900 Subject: [PATCH] fix: refresh draft release on every push to main Two issues prevented the draft release from tracking current state: 1. path filter 'paths: [action.yml]' meant that commits touching only scripts, workflows, or docs never triggered a draft refresh, so PRs merged after an action.yml-only window went unrecorded. 2. softprops/action-gh-release preserves an existing draft when it finds one for the same tag, keeping the body frozen at the first-create date. Adding an explicit delete step before the action ensures a fresh draft is always created with up-to-date generated notes. --- .github/workflows/prepare-draft-release.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prepare-draft-release.yml b/.github/workflows/prepare-draft-release.yml index 04d03ed..de8868c 100644 --- a/.github/workflows/prepare-draft-release.yml +++ b/.github/workflows/prepare-draft-release.yml @@ -3,8 +3,6 @@ name: prepare draft release on: push: branches: [main] - paths: - - action.yml workflow_dispatch: inputs: version: @@ -83,7 +81,15 @@ jobs: echo "release ${VERSION} already exists and is published; choose a new version" >&2 exit 1 - - name: Create or update draft release + - name: Delete existing draft release + env: + GH_TOKEN: ${{ github.token }} + VERSION: ${{ steps.version.outputs.version }} + run: | + set -euo pipefail + gh release delete "${VERSION}" --repo "${GITHUB_REPOSITORY}" --yes 2>/dev/null || true + + - name: Create draft release with current release notes uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3 with: tag_name: ${{ steps.version.outputs.version }}