Add manifest-path to allow cargo projects at any location

This commit is contained in:
Jonas Bushart
2022-11-21 21:32:05 +01:00
parent 35e7a82eb3
commit 3e2206ce92
3 changed files with 24 additions and 1 deletions

View File

@@ -6,6 +6,12 @@ branding:
icon: "check-square"
color: "yellow"
inputs:
manifest-path:
description: "Specify the --manifest-path argument to rustfmt"
required: false
default: "./Cargo.toml"
runs:
using: composite
steps:
@@ -14,7 +20,7 @@ runs:
run: |
# Run cargo and store the original output
CARGO_STATUS=0
CARGO_OUTPUT=$(cargo fmt --all -- --color=always --check 2>/dev/null) || CARGO_STATUS=$?
CARGO_OUTPUT=$(cargo fmt --all --manifest-path=${{ inputs.manifest-path }} -- --color=always --check 2>/dev/null) || CARGO_STATUS=$?
if [ ${CARGO_STATUS} -eq 0 ]; then
cat <<MARKDOWN_INTRO >> $GITHUB_STEP_SUMMARY