Skip to content

Commit

Permalink
Improved: Don't accept empty lines as cargo paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Nov 10, 2024
1 parent fd91c5f commit 73cb0c4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ runs:
if: inputs.crates-io-token != ''
shell: bash
run: |
while IFS= read -r path; do
# Trim whitespace and handle empty lines
echo "${{ inputs.rust-project-paths }}" | while read -r path || [[ -n "$path" ]]; do
# Skip empty lines
if [[ -z "$path" ]]; then
continue
fi
# Trim whitespace
path=$(echo "$path" | xargs)
echo "Publishing Rust package at path: $path"
cargo publish --token ${{ inputs.crates-io-token }} ${{ inputs.additional-publish-params }} --manifest-path "$path/Cargo.toml"
done <<< "${{ inputs.rust-project-paths }}"
cargo publish --token "${{ inputs.crates-io-token }}" ${{ inputs.additional-publish-params }} --manifest-path "$path/Cargo.toml"
done

0 comments on commit 73cb0c4

Please sign in to comment.