Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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=""

@williammartin williammartin May 10, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using bash shortcircuiting logic to only set guard="" in the case that $DO_PUBLISH is not false right? i.e. if $DO_PUBLISH is anything other than false, we set guard to the empty string so that gh release create runs, rather than just echo-ing the command?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If DO_PUBLISH is false, we want to print what would be done, but not actually cut a Release. It's a sort of a lightweight no-op mechanism.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh gotcha

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, '-') }}
Expand Down
2 changes: 1 addition & 1 deletion script/label-assets
Original file line number Diff line number Diff line change
Expand Up @@ -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