mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-20 03:25:56 +00:00
Preserve published assets on manual publishing retries as well
This commit is contained in:
1 parent
e87cd0bb78
commit
517e04dace
1 file changed
+2
-1
@@ -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']
|
||||
|
||||
Reference in new issue
Block a user