Preserve published assets on manual publishing retries as well

This commit is contained in:
Дмитрий committed 2026-10-21 23:39:02 +05:00
1 parent e87cd0bb78
commit 517e04dace
1 file changed
+2 -1
+2 -1
View File
@@ -25,11 +25,12 @@ jobs:
name: Keep already published release assets immutable
env:
GH_TOKEN: ${{ github.token }}
REQUEST_PUBLISH: ${{ inputs.publish_release && 'true' || 'false' }}
run: |
python3 - <<'PY'
import json, os, subprocess
build = True
if os.environ['GITHUB_EVENT_NAME'] == 'push':
if os.environ['GITHUB_EVENT_NAME'] == 'push' or os.environ.get('REQUEST_PUBLISH') == 'true':
result = subprocess.run(['gh', 'api', 'repos/' + os.environ['GITHUB_REPOSITORY'] + '/releases/tags/' + os.environ['GITHUB_REF_NAME']], capture_output=True, text=True)
if result.returncode == 0:
build = json.loads(result.stdout)['draft']