Skip to content

bodyFile is removed on updates - possibly generateReleaseNotes does not respect omitBodyDuringUpdate #513

@tjcouch-sil

Description

@tjcouch-sil

Describe the bug
When you upload to the same release multiple times with updates allowed, generateReleaseNotes seems to write over the body, disregarding omitBodyDuringUpdate. However, bodyFile properly does not write during the update. As such, the first release that happens produces the body with release notes under it as expected. However, subsequent updates to the release remove the body and just have release notes.

To Reproduce
Steps to reproduce the behavior:

  1. Run the action with bodyFile, generateReleaseNotes, and omitBodyDuringUpdate.
  2. Notice the release body has both bodyFile and release notes.
  3. Run the action again to update the release
  4. Notice the release body only has release notes now.

Expected behavior
The body according to bodyFile stays the same between updates when omitBodyDuringUpdate is true. Maybe the newly generated release notes on every update could remove only the previous generated release notes instead of writing over the whole body.

Alternatively, if that's too challenging/error-prone, you could just put bodyFile + newly generated release notes in the body on every update, effectively reverting any changes someone has made to the body since the last release. That would work fine for my current situation, but I think that would probably not make sense considering that omitBodyDuringUpdate seems to indicate the body won't get written over.

Desktop (please complete the following information):

  • OS: Windows, Mac, Linux
  • Version 1.16.0

Additional context
#497 seems to make some changes related to this but notes that it is hard to know what should happen with omitBodyDuringUpdate.

My workflow step using this action:

      - name: Publish draft release
        uses: ncipollo/release-action@v1
        with:
          # Need to allow updates in order to upload artifacts from each OS
          allowUpdates: true
          artifactErrorsFailBuild: true
          artifacts: |
            release/staged/*
          bodyFile: .github/assets/release-body.md
          # make the new release a draft instead of automatically publishing
          draft: true
          generateReleaseNotes: true
          # if the release already exists, leave its metadata alone
          omitBodyDuringUpdate: true
          omitNameDuringUpdate: true
          omitPrereleaseDuringUpdate: true
          # make the new release a pre-release
          prerelease: true
          tag: v${{ inputs.version }}
          # only update if the release is still a draft
          updateOnlyUnreleased: true

Here is the full workflow file

Here is a link to see the logs for the workflow run

Thank you very much! I really appreciate this action. It's really helpful for my team!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions