Skip to content

[Bug]: Given value of variable is not being included in the final release #766

@Juansecu

Description

@Juansecu

Pre-flight checks

  • I searched existing issues and did not find a duplicate
  • I reproduced this with the latest released version or current master
  • I included a reproducible example or a sanitized/redacted reproduction path if the original repository is private

action-gh-release version

v2

Runner operating system

ubuntu-latest

Release target repository

No response

Reproduction repo, gist, or artifact

No response

Workflow snippet

Run softprops/action-gh-release@v2
  with:
    name: 1.0.0
    body: Version 1.0.0 of the ecommerce application.
    draft: false
    fail_on_unmatched_files: true
    generate_release_notes: true
    prerelease: false
    overwrite_files: true
    token: ***
  env:
    PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
    VERSION: 1.0.0

Expected behavior

Given the following input:

Run softprops/action-gh-release@v2
with:
name: 1.0.0
body: Version 1.0.0 of the ecommerce application.
draft: false
files: ***
fail_on_unmatched_files: true
generate_release_notes: true
prerelease: false
overwrite_files: true
token: ***
env:
PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
VERSION: 1.0.0

I expect to get a release with name 1.0.0 and body Version 1.0.0 of the ecommerce application.

Actual behavior

Given the following input:

Run softprops/action-gh-release@v2
with:
name: 1.0.0
body: Version 1.0.0 of the ecommerce application.
draft: false
files: ***
fail_on_unmatched_files: true
generate_release_notes: true
prerelease: false
overwrite_files: true
token: ***
env:
PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
VERSION: 1.0.0

I'm getting a release with name v1.0.0 (the original name with the tag) and body Version of the ecommerce application.

Steps to reproduce

  1. Create the following workflow:
name: Deliver Application

on:
  push:
    tags:
      - 'v*.*.*'

jobs:
  substring-version:
    runs-on: ubuntu-latest
    outputs:
      version: ${{ steps.substring.outputs.substring }}
    steps:
      - name: Substring version
        id: substring
        uses: bhowell2/github-substring-action@1.0.2
        with:
          value: ${{ github.event_name == 'push' && github.ref_name || github.event.inputs.version }}
          index_of_str: v

  release-application:
    runs-on: ubuntu-latest
    needs: substring-version
    permissions:
      contents: write
    steps:
      - run: echo "VERSION=${{ needs.substring-version.outputs.version }}" >> $GITHUB_ENV
      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        env:
          VERSION: ${{ needs.substring-version.outputs.version }}
        with:
          name: ${{ env.VERSION }}
          body: Version ${{ env.VERSION }} of the ecommerce application.
          draft: false
          generate_release_notes: true
          prerelease: false
  1. Push a tag named v1.0.0
  2. You will see that the - run: echo "VERSION=${{ needs.substring-version.outputs.version }}" >> $GITHUB_ENV step prints 1.0.0, but the action creates the release with the original name of the tag, and the body includes an empty space instead of the cut name of the tag

Relevant logs

👩‍🏭 Creating new GitHub release for tag v1.0.0...
↪️ Using release 296439299 for tag v1.0.0 instead of duplicate draft 297279970
🧹 Removing duplicate draft release 297279970 for tag v1.0.0...
Finalizing release...
Getting assets list...
🎉 Release ready at ***

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions