Skip to content

Commit

Permalink
Replace yq with toml-cli and jq
Browse files Browse the repository at this point in the history
  • Loading branch information
sbtaylor15 committed Dec 7, 2022
1 parent 5820c81 commit 7fea98d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ runs:
if: "${{ env.RUST_VERSION == '' }}"
run: |
set -e
# yq includes tomlq
pip3 install yq 2>&1 1>/dev/null
echo "RUST_VERSION=$(tomlq -r ".package.rust" Cargo.toml 2>/dev/null || echo stable)" >> $GITHUB_ENV
# Install toml to json cli
npm i -g toml-cli
echo "RUST_VERSION=$(cat Cargo.toml 2>/dev/null | toml | jq -r 'try(.package.rust) // "stable"')" >> $GITHUB_ENV
# Clean older versions of rustfmt and cargo-fmt to prevent warnings
rm -f /home/runner/.cargo/bin/rustfmt
rm -f /home/runner/.cargo/bin/cargo-fmt
Expand Down

0 comments on commit 7fea98d

Please sign in to comment.