Merge pull request #7424 from cli/deployment-release-guard

Fix release guard for deployment workflow
This commit is contained in:
Mislav Marohnić 2023-05-11 10:57:32 +02:00 committed by GitHub
commit 07d3a7e302
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -293,6 +293,7 @@ jobs:
cp -a upload/* site/packages/
- name: Create the release
env:
# In non-production environments, the assets will not have been signed
DO_PUBLISH: ${{ inputs.environment == 'production' }}
TAG_NAME: ${{ inputs.tag_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -313,9 +314,9 @@ jobs:
else
release_args+=( --discussion-category "General" )
fi
action="echo"
[ "$DO_PUBLISH" = "false" ] || action="command"
script/label-assets dist/gh_* | xargs $action gh release create "${release_args[@]}" --
guard="echo"
[ "$DO_PUBLISH" = "false" ] || guard=""
script/label-assets dist/gh_* | xargs $guard gh release create "${release_args[@]}" --
- name: Publish site
env:
DO_PUBLISH: ${{ inputs.environment == 'production' && !contains(inputs.tag_name, '-') }}

View file

@ -16,5 +16,5 @@ for asset; do
*.deb ) label="${label} deb" ;;
*.rpm ) label="${label} RPM" ;;
esac
printf "%s#%s\n" "$asset" "$label"
printf '"%s#%s"\n' "$asset" "$label"
done