My github project runs GH action on release to publish my Rust crate.
When I create a new release and “publish” it, the release stays published
for a few seconds, and later automatically changes to draft
. The CI passes fine, and publishes everything correctly, but the release stays as draft
. Clicking publish
on it again re-triggers the same action, which results in a failure (because the same version cannot be pushed to crates.io twice). Is there a proper way to run publishing script whenever release is created?
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
workflow_dispatch:
It looks like you configured your CI to publish draft releases here and here.
These end up running after you publish a release. Until GitHub deletes historical logs, evidence of that is here.
Then actions-gh-release
finds your manually created release here and changes it to a draft here.
You wouldn’t have to re-release if you corrected your workflow file to avoid marking the original release as a draft.
2