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

Even with "draft: false", drafts get made #379

Open
probonopd opened this issue Aug 14, 2023 · 6 comments
Open

Even with "draft: false", drafts get made #379

probonopd opened this issue Aug 14, 2023 · 6 comments

Comments

@probonopd
Copy link

I am using this:

    - name: Upload Artifacts to GitHub Releases
      uses: softprops/action-gh-release@v1
      with:
        files: |
          build/attrutil
        tag_name: continuous
        target_commitish: ${{ github.sha }}
        draft: false

https://github.com/probonopd/attrutil/blob/main/.github/workflows/build.yml

I was hoping that thanks to draft: false, the releases would not be created as drafts, but they are.

@boozook
Copy link

boozook commented Sep 14, 2023

I suppose that there's Github's "boo is not bool"-problem. Try to use strings like 'false'
or if you really need bool - pass empty string "" or ${{ null }}, so it casts to boolean as false.

@probonopd
Copy link
Author

Thanks @boozook. Is this a change @softprops would need to make in this action, or should it work if I simply set draft: ${{ null }} instead of draft: false?

@boozook
Copy link

boozook commented Sep 16, 2023

@probonopd, looking at that line I suppose the value is interpreting as following:

  • true if value == "true" (string)
  • false (actually undefined, sic!) for any other value.

Also there input is defined as empty by default.

So in this case for false I could try ${{ null }} or empty string as by default.

Anyway, it's just my suppose, I'm not sure and I'm not a guru of this language.

FYI: As I remember "false" casts to bool as true because in bytes this isn't empty or zero.
For example "0" == false => true.

@PredatorCZ
Copy link

I've had the same issue. I am using the same workflow (remove tag + release, then release again).
draft is false by default, so there is no need to explicitly specify it.
I've fixed this issue by putting sleep between deletion and release steps. (In your example on this line: https://github.com/probonopd/attrutil/blob/a87a383bcd9061fee192208572de9fae3a141e8b/.github/workflows/build.yml#L37)

Very simple code:

    - name: Wait a sec
      run: sleep 2

Sleep variable should be tweaked

The reasoning for sleep is, that GH API is slower then action script, so by the time CI is releasing, deletion is still queued on gh side. But that is just a silly theory of mine.

probonopd added a commit to probonopd/attrutil that referenced this issue Dec 10, 2023
probonopd added a commit to probonopd/buntu-iso-builder that referenced this issue Dec 10, 2023
probonopd added a commit to probonopd/custom-raspberry-pi-os that referenced this issue Dec 10, 2023
@probonopd
Copy link
Author

Still doesn't seem to work:

https://github.com/probonopd/attrutil/releases

@PredatorCZ
Copy link

I'm also using delete-tag-and-release action instead of git command to remove previous releases.
Or/and increase wait time, 2s delay is working for me, that doesn't mean it's the rule.

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

3 participants