Refactor the logic for checking `workflow` scope checking in releases to be in the positive - check if the scope is there, not check if it isn't there. Then, when the function is called we invert it.
Also update comments to be more imperative.
This refactor also incorporates @andyfeller's suggestion to use `slices`.
Co-Authored-By: Andy Feller <andyfeller@github.com>
When publishing a release, we rely on server-side validation to abort the operation if an existing published release with the same tag name already exists.
However, then creating a release with assets, we first create a draft release, upload assets to it, then publish. If there was an existing release with the same tag name, the operation would fail but it would leave behind a temporary draft release with assets. This makes the operation fail earlier, before creating any records.
If `gh release create <TAG>` was called and TAG exists locally but not on the remote, this warns about the unpushed tag to avoid recreating it on the remote. The user can pass a value for `--target` to silence the warning.