ncipollo / release-action

An action which manages a github release

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update a draft release?

Bradleycorn opened this issue · comments

I guess this action cannot be used to update a draft release?

Looking at the createOrUpdateRelease function, it looks like it finds a release by tag, and updates it if found. But a tag only gets created when a release is published. So if you have a draft release, there is no tag (yet).

Do I have that right?

But a tag only gets created when a release is published
The draft release needs to be associated with a tag. You can't update a draft which doesn't have a tag.

@ncipollo I do set a tag. But as far as I understand it, GITHUB doesn't actually create a tag until a release is published.

The UI indicates this when you create a release in the browser:
image

For context, I have a single job, with several steps.
In one of the first steps, I create a draft release (note, I do specify a tag)

     - name: Create Draft Release
        uses: ncipollo/release-action@v1
        with:
          draft: true
          commit: ${{ github.ref_name }}
          tag: ${{ inputs.version }}
          name: ${{ inputs.version }}
          bodyFile: "Release.md"

Then, several steps later, I try to update (publish) the release:

      - name: Publish Release
        uses: ncipollo/release-action@v1
        with:
          allowUpdates: true
          updateOnlyUnreleased: true
          draft: false
          commit: ${{ github.ref_name }}
          tag: ${{ inputs.version }}
          name: ${{ inputs.version }}
          omitBodyDuringUpdate: true

But instead 2 releases are created, the draft release, and another, published release. What am I doing wrong?