From e745691c901780b73dfc93463941fd8d75626e0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Jul 2026 07:50:07 +0000 Subject: [PATCH] fix: remove unreachable semver pre-step, have agent compute version from git The `semver` step was in the `steps:` block (compiled into the agent job), but its outputs were referenced in the prompt template which is built in the activation job. Since `steps.semver.outputs.*` is always empty in the activation job context, the agent received empty version strings and called `noop` instead of `create_release`. Fix: remove the semver pre-step and update the task to have the agent compute the next version itself from `git describe --tags` plus the `${{ github.event.inputs.bump }}` input (which IS properly interpolated as an event input). Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/create-release.lock.yml | 21 ++------- .github/workflows/create-release.md | 54 ++++++++++------------- 2 files changed, 27 insertions(+), 48 deletions(-) diff --git a/.github/workflows/create-release.lock.yml b/.github/workflows/create-release.lock.yml index b818a9f..8d69285 100644 --- a/.github/workflows/create-release.lock.yml +++ b/.github/workflows/create-release.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"707c5d3134bfc2c74bc1b1487a3cd1dda68fc3581835c7b9f0034c016b7e63d1","body_hash":"49456d11d09ccb7cfa77288b30c718f6c066540dc136df80fc17ad601030024f","compiler_version":"v0.83.1","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.73"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"92ef2f7a7510ef35ce5bf0b016ba7dc0c95c086bacbe5ffeae7bb0b118b0a245","body_hash":"eea1a0e3858cadb0c71efc32a1228ab417543a729509ce0b0de7f1c8ff860630","compiler_version":"v0.83.1","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.73"}} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"v0.83.1","version":"v0.83.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.38","digest":"sha256:cb928eb62d9139a013c2d278dab19af232d35a2d83dca71a3d98eb431f786243","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.38@sha256:cb928eb62d9139a013c2d278dab19af232d35a2d83dca71a3d98eb431f786243"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.38","digest":"sha256:cd6145620d96acee46e1ede25180a13aa36002467e663db0caa453a8bc8eb60c","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.38@sha256:cd6145620d96acee46e1ede25180a13aa36002467e663db0caa453a8bc8eb60c"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.38","digest":"sha256:c30c5319da37505d42f95cb3faa2cfa55e794ccb5cc805dbd9201410d1ac2a3e","pinned_image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.38@sha256:c30c5319da37505d42f95cb3faa2cfa55e794ccb5cc805dbd9201410d1ac2a3e"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.38","digest":"sha256:6c19094d95aad5f9f128ad5e583f0f2b894b158aa66c3b86dd9bcc90970a2917","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.38@sha256:6c19094d95aad5f9f128ad5e583f0f2b894b158aa66c3b86dd9bcc90970a2917"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.3","digest":"sha256:3c744710ea275cd5ee65db92a1099e0d980754bd9fafda9ce67704c67004dc83","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.3@sha256:3c744710ea275cd5ee65db92a1099e0d980754bd9fafda9ce67704c67004dc83"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.6.0","digest":"sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3","pinned_image":"ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3"}]} # This file was automatically generated by gh-aw (v0.83.1). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -23,7 +23,7 @@ # # For more information: https://github.github.com/gh-aw/introduction/overview/ # -# On demand, runs the full build (typecheck + tests), computes the next semver version from the latest git tag and the requested bump type (patch/minor/major), then has the AI agent summarize commits and publish a draft GitHub release. +# On demand, runs the full build (typecheck + tests), then has the AI agent compute the next semver version from the latest git tag, summarize commits, and publish a draft GitHub release. # # Secrets used: # - COPILOT_GITHUB_TOKEN @@ -252,8 +252,6 @@ jobs: GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} - GH_AW_STEPS_SEMVER_OUTPUTS_NEXT_VERSION: ${{ steps.semver.outputs.next_version }} - GH_AW_STEPS_SEMVER_OUTPUTS_PREVIOUS_TAG: ${{ steps.semver.outputs.previous_tag }} # poutine:ignore untrusted_checkout_exec run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" @@ -313,8 +311,6 @@ jobs: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_ENGINE_ID: "copilot" GH_AW_GITHUB_EVENT_INPUTS_BUMP: ${{ github.event.inputs.bump }} - GH_AW_STEPS_SEMVER_OUTPUTS_NEXT_VERSION: ${{ steps.semver.outputs.next_version }} - GH_AW_STEPS_SEMVER_OUTPUTS_PREVIOUS_TAG: ${{ steps.semver.outputs.previous_tag }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -335,8 +331,6 @@ jobs: GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools' - GH_AW_STEPS_SEMVER_OUTPUTS_NEXT_VERSION: ${{ steps.semver.outputs.next_version }} - GH_AW_STEPS_SEMVER_OUTPUTS_PREVIOUS_TAG: ${{ steps.semver.outputs.previous_tag }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -357,9 +351,7 @@ jobs: GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE, - GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST, - GH_AW_STEPS_SEMVER_OUTPUTS_NEXT_VERSION: process.env.GH_AW_STEPS_SEMVER_OUTPUTS_NEXT_VERSION, - GH_AW_STEPS_SEMVER_OUTPUTS_PREVIOUS_TAG: process.env.GH_AW_STEPS_SEMVER_OUTPUTS_PREVIOUS_TAG + GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST } }); - name: Validate prompt placeholders @@ -478,11 +470,6 @@ jobs: run: npm run typecheck - name: Test run: npm test - - env: - BUMP: ${{ github.event.inputs.bump }} - id: semver - name: Compute next version - run: "git fetch --tags\nLATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo \"v0.0.0\")\nCURRENT=\"${LATEST_TAG#v}\"\nIFS='.' read -r MAJOR MINOR PATCH <<< \"$CURRENT\"\nMAJOR=${MAJOR:-0}; MINOR=${MINOR:-0}; PATCH=${PATCH:-0}\ncase \"$BUMP\" in\n major) MAJOR=$((MAJOR+1)); MINOR=0; PATCH=0 ;;\n minor) MINOR=$((MINOR+1)); PATCH=0 ;;\n *) PATCH=$((PATCH+1)) ;;\nesac\nNEXT=\"${MAJOR}.${MINOR}.${PATCH}\"\necho \"next_version=${NEXT}\" >> \"$GITHUB_OUTPUT\"\necho \"previous_tag=${LATEST_TAG}\" >> \"$GITHUB_OUTPUT\"" - name: Configure Git credentials env: @@ -1393,7 +1380,7 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "Create Release" - WORKFLOW_DESCRIPTION: "On demand, runs the full build (typecheck + tests), computes the next semver version from the latest git tag and the requested bump type (patch/minor/major), then has the AI agent summarize commits and publish a draft GitHub release." + WORKFLOW_DESCRIPTION: "On demand, runs the full build (typecheck + tests), then has the AI agent compute the next semver version from the latest git tag, summarize commits, and publish a draft GitHub release." HAS_PATCH: ${{ needs.agent.outputs.has_patch }} with: script: | diff --git a/.github/workflows/create-release.md b/.github/workflows/create-release.md index 98c830c..6a7b06b 100644 --- a/.github/workflows/create-release.md +++ b/.github/workflows/create-release.md @@ -2,9 +2,9 @@ emoji: 🚀 name: Create Release description: > - On demand, runs the full build (typecheck + tests), computes the next semver - version from the latest git tag and the requested bump type (patch/minor/major), - then has the AI agent summarize commits and publish a draft GitHub release. + On demand, runs the full build (typecheck + tests), then has the AI agent + compute the next semver version from the latest git tag, summarize commits, + and publish a draft GitHub release. on: workflow_dispatch: inputs: @@ -36,24 +36,6 @@ steps: run: npm run typecheck - name: Test run: npm test - - name: Compute next version - id: semver - env: - BUMP: ${{ github.event.inputs.bump }} - run: | - git fetch --tags - LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - CURRENT="${LATEST_TAG#v}" - IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" - MAJOR=${MAJOR:-0}; MINOR=${MINOR:-0}; PATCH=${PATCH:-0} - case "$BUMP" in - major) MAJOR=$((MAJOR+1)); MINOR=0; PATCH=0 ;; - minor) MINOR=$((MINOR+1)); PATCH=0 ;; - *) PATCH=$((PATCH+1)) ;; - esac - NEXT="${MAJOR}.${MINOR}.${PATCH}" - echo "next_version=${NEXT}" >> "$GITHUB_OUTPUT" - echo "previous_tag=${LATEST_TAG}" >> "$GITHUB_OUTPUT" safe-outputs: jobs: create-release: @@ -99,15 +81,25 @@ safe-outputs: ## Task -You are preparing release **v${{ steps.semver.outputs.next_version }}** -(a **${{ github.event.inputs.bump }}** bump from `${{ steps.semver.outputs.previous_tag }}`). +This is a **${{ github.event.inputs.bump }}** release. The build has already passed. Your job is to determine the next version, summarize what changed since the previous release, and create the draft release. -The build has already passed. Your job is to summarize what changed since the previous release and create the draft release. +### Step 1 — Determine the next version -### Step 1 — Gather commits since the previous release +```bash +git fetch --tags && git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0" +``` + +Note the previous tag printed above. Then compute the next semver version by applying a **${{ github.event.inputs.bump }}** bump: +- `patch`: increment the patch number (e.g. `v1.2.3` → `1.2.4`) +- `minor`: increment the minor number, reset patch (e.g. `v1.2.3` → `1.3.0`) +- `major`: increment the major number, reset minor and patch (e.g. `v1.2.3` → `2.0.0`) + +### Step 2 — Gather commits since the previous release + +Replace `` with the tag from Step 1: ```bash -git log ${{ steps.semver.outputs.previous_tag }}..HEAD --oneline +git log ..HEAD --oneline ``` If the previous tag was `v0.0.0` (no prior release), list all commits instead: @@ -116,7 +108,7 @@ If the previous tag was `v0.0.0` (no prior release), list all commits instead: git log --oneline ``` -### Step 2 — Read package metadata +### Step 3 — Read package metadata ```bash cat package.json @@ -124,7 +116,7 @@ cat package.json Use the package name and description to add context to the release notes. -### Step 3 — Categorize the commits +### Step 4 — Categorize the commits Group commits into the following categories (omit empty ones): @@ -135,11 +127,11 @@ Group commits into the following categories (omit empty ones): - **Documentation** — commits starting with `docs:` - **Internal** — chores, tests, and CI changes (summarize briefly, do not list individually) -### Step 4 — Create the release +### Step 5 — Create the release Call the `create_release` tool with: -- `version`: `${{ steps.semver.outputs.next_version }}` +- `version`: the computed next version string (without the `v` prefix, e.g. `1.2.4`) - `draft`: `true` - `body`: A GitHub-flavored markdown release description with: - A short summary paragraph @@ -147,4 +139,4 @@ Call the `create_release` tool with: - Breaking changes prominently at the top if any exist - Upgrade instructions only if the release contains breaking changes -Call `noop` if the commit list is empty or if a tag `v${{ steps.semver.outputs.next_version }}` already exists. +Call `noop` if the commit list is empty or if the computed tag already exists in the repo.