Skip to content

Commit

Permalink
🤖 fix false negative when using jq to determine msrv
Browse files Browse the repository at this point in the history
- error when msrv commands fail
  • Loading branch information
ttytm committed Nov 1, 2024
1 parent 467bd84 commit fd01c83
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ jobs:
mv "${artifact}/cargo-msrv" ./
- name: Detect MSRV changes
run: |
defined_msrv="$(./cargo-msrv show --output-format json 2>&1 | ./jq -r '.result.version' | tail -n 1)"
dependency_msrv="$(./cargo-msrv list --output-format json 2>&1 | ./jq -r '.result.list.[0].msrv' | tail -n 1)"
defined_msrv="$(./cargo-msrv show --output-format json 2>&1 | jq -r '.result.version' | tail -n 1)"
dependency_msrv="$(./cargo-msrv list --output-format json 2>&1 | jq -r '.result.list[0].msrv' | tail -n 1)"
echo "defined_msrv=$defined_msrv"
echo "dependency_msrv=$dependency_msrv"
if [ -z "$defined_msrv" ] || [ -z "$dependency_msrv" ]; then
echo "::error::Failed to detect MSRV"
exit 1
fi
if [ "$defined_msrv" != "$dependency_msrv" ]; then
echo "::error::MSRV changed | defined: '$defined_msrv', absolute: '$dependency_msrv'"
exit 1
Expand Down

0 comments on commit fd01c83

Please sign in to comment.