From 9920ff42dd7a5093c192a4a0aa68a550e627f6bd Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 17 Sep 2026 22:34:54 +0000 Subject: [PATCH] ci(publish): honour the publish issue's target checklist Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/publish.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dca3653..bf68868 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,6 +25,7 @@ jobs: id: inputs env: ISSUE_TITLE: ${{ github.event.issue.title }} + ISSUE_BODY: ${{ github.event.issue.body }} run: | # Title format: "publish: owner/repo@VERSION" VERSION=$(echo "$ISSUE_TITLE" | grep -oP '@\K[^\s]+$') @@ -34,6 +35,26 @@ jobs: fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" + # Craft itself never reads the issue: the "### Targets" checklist is + # honoured by translating it into explicit `--target` flags. Checked + # boxes mean "already done, skip"; when everything is checked we pass + # the special target `none`, which runs only the post-publish steps + # (tag, merge the release branch back, delete it). + TARGETS_SECTION=$(echo "$ISSUE_BODY" | sed -n '/### Targets/,/Checked targets will be skipped/p') + PENDING=$(echo "$TARGETS_SECTION" | grep -oP '^\s*-\s*\[ \]\s+\K\S+' || true) + ALL=$(echo "$TARGETS_SECTION" | grep -oP '^\s*-\s*\[[ xX]\]\s+\K\S+' || true) + TARGET_ARGS="" + if [[ -n "$ALL" && "$PENDING" != "$ALL" ]]; then + if [[ -z "$PENDING" ]]; then + TARGET_ARGS="--target none" + else + while read -r target; do + TARGET_ARGS+=" --target $target" + done <<< "$PENDING" + fi + fi + echo "target_args=$TARGET_ARGS" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@v6 with: ref: release/${{ steps.inputs.outputs.version }} @@ -71,7 +92,7 @@ jobs: sudo chmod +x /usr/local/bin/craft - name: Publish - run: craft publish "${{ steps.inputs.outputs.version }}" --no-input + run: craft publish "${{ steps.inputs.outputs.version }}" --no-input ${{ steps.inputs.outputs.target_args }} env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}