60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
name: find
|
|
description: "Find files matching a specific pattern."
|
|
inputs:
|
|
path:
|
|
description: "Path to search in."
|
|
required: false
|
|
default: "."
|
|
pattern:
|
|
description: "Pattern to search for (supports glob patterns)."
|
|
required: true
|
|
type:
|
|
description: "Type of files to find (f=files, d=directories, l=links)."
|
|
required: false
|
|
default: "f"
|
|
maxDepth:
|
|
description: "Maximum depth to search."
|
|
required: false
|
|
default: ""
|
|
minDepth:
|
|
description: "Minimum depth to search."
|
|
required: false
|
|
default: ""
|
|
size:
|
|
description: "Size constraint (e.g., +100k, -1M)."
|
|
required: false
|
|
default: ""
|
|
modified:
|
|
description: "Modified time constraint (e.g., -1, +7)."
|
|
required: false
|
|
default: ""
|
|
additionalArgs:
|
|
description: "Additional arguments to pass to find command."
|
|
required: false
|
|
default: ""
|
|
outputs:
|
|
files:
|
|
description: "List of found files (newline separated)."
|
|
value: ${{ steps.find.outputs.files }}
|
|
count:
|
|
description: "Number of files found."
|
|
value: ${{ steps.find.outputs.count }}
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: "Find files."
|
|
id: find
|
|
run: |
|
|
NAME="Find"
|
|
echo "::group::$NAME - Inputs"
|
|
echo "${{ toJSON(inputs) }}"
|
|
echo "::endgroup::"
|
|
|
|
bash "${{ github.action_path }}/find.sh" "${{ inputs.path }}" "${{ inputs.pattern }}" "${{ inputs.type }}" \
|
|
"${{ inputs.maxDepth }}" "${{ inputs.minDepth }}" "${{ inputs.size }}" "${{ inputs.modified }}" "${{ inputs.additionalArgs }}"
|
|
|
|
echo "::group::$NAME - Outputs"
|
|
cat "$GITHUB_OUTPUT"
|
|
echo "::endgroup::"
|
|
shell: bash
|