Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get draft update working #8

Closed
sondreb opened this issue Dec 25, 2019 · 8 comments
Closed

Unable to get draft update working #8

sondreb opened this issue Dec 25, 2019 · 8 comments

Comments

@sondreb
Copy link

sondreb commented Dec 25, 2019

I'm trying to use the action to create a new release and update that release. Unfortunately it keeps creating new releases.

Have done what is mentioned in the notes, specifying both tag and commit, but still creates duplicates. Have tried with bot the sha variable, and "master".

It appears perhaps that the tag is not created?

- name: Release
  uses: ncipollo/release-action@v1
  with:
    artifacts: "${{env.RELEASE_NAME}}"
    allowUpdates: true
    token: ${{ secrets.GITHUB_TOKEN }}
    draft: true
    prerelease: true
    name: "City Chain (Release ${{env.VERSION}})"
    #commit: "${{github.sha}}"
    commit: master
    tag: v${{env.VERSION}}

Screenshot of produced releases:

image

@ncipollo
Copy link
Owner

Hi!

The issue is that GitHub allows you to have multiple drafts which point to the same tag (unlike normal releases). I'm not sure of the best way to updating draft releases because of this (should the action update all, just the most recent, etc).

@giancarlokc
Copy link

I've run into the same issue. I have a build for each platform (Linux, Windows and Mac) and a need to push all artifacts into the same draft release.

I know I can do that by using two separate actions (one to create release and another to update the artifacts), but your action was interesting because of this update feature. Hopefully there's a way to force udpates to draft releases.

@ncipollo ncipollo reopened this Jan 3, 2020
@ncipollo
Copy link
Owner

ncipollo commented Jan 3, 2020

The action will now attempt to update draft releases. A few notes:

  • The action will still prefer to update a published release if one exists for a given tag (i.e it would update this rather than a draft pointing to the same tag).
  • If multiple drafts exist which point to the same tag it will only update the first one it encounters.
  • If the draft release is super old, such that it's not within the first page of release results, it will not get updated. This is an intentional tradeoff to avoid needing to send multiple releases requests to github.

@ncipollo ncipollo closed this as completed Jan 3, 2020
@simontom
Copy link

simontom commented Mar 1, 2020

Hi, is it possible to update already existing file in Draft-Release?

@ncipollo
Copy link
Owner

ncipollo commented Mar 2, 2020

@simontom,
It's not currently possible to overwrite an existing artifact, I'll take a look at adding an option for that.

@mrchief
Copy link

mrchief commented Jul 26, 2020

When it updates the draft release, can it also update the status? E.g.,

          allowUpdates: true
          draft: false
          ...

also updates the draft release to published?

@ncipollo
Copy link
Owner

@mrchief ,
As far as I can tell this scenario should work. If you look at the following two action runs, I start with a draft, then update it to be a published release:

Apologies if I'm misunderstanding your use case.

@mrchief
Copy link

mrchief commented Jul 27, 2020

Yeah it's similar to what I tried but for me it created a draft release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants