Added many, many more actions.

This commit is contained in:
2025-06-24 15:24:16 -07:00
parent 62fbe4dead
commit 57ef232d2b
108 changed files with 4212 additions and 7 deletions

44
utils/compare/action.yaml Normal file
View File

@@ -0,0 +1,44 @@
name: compare
description: "Compare the output of a command to an expected value."
inputs:
expected:
description: "Expected output."
required: false
actual:
description: "Actual output."
required: true
exitOnFail:
description: "Should the program exit on a failure."
required: true
default: "true"
outputs:
success:
description: "The result of the comparison."
value: ${{ steps.compare.outputs.success }}
runs:
using: "composite"
steps:
- name: "Compare input and output"
id: compare
run: |
EXPECTED=$(cat <<EOF
${{ inputs.expected }}
EOF
)
ACTUAL=$(cat <<EOF
${{ inputs.actual }}
EOF
)
if [[ "$EXPECTED" == "$ACTUAL" ]]; then
echo "success=true" >> "$GITHUB_OUTPUT"
else
echo "success=false" >> "$GITHUB_OUTPUT"
if [[ "${{ inputs.exitOnFail }}" == "true" ]]; then
echo EXPECTED: "$EXPECTED"
echo --------------------------------
echo ACTUAL: "$ACTUAL"
exit 1
fi
fi
shell: bash