diff --git a/minio/mc-find/action.yaml b/minio/mc-find/action.yaml index d372a6d..bd56608 100644 --- a/minio/mc-find/action.yaml +++ b/minio/mc-find/action.yaml @@ -17,13 +17,20 @@ inputs: path: description: "The path to search for." required: true - args: + name: + description: "The name pattern to search for." + required: true + default: "" + additionalArgs: description: "Additional arguments." required: false outputs: files: description: "The path of the found file." value: ${{ steps.output.outputs.files }} + console: + description: "The console output of the command." + value: ${{ steps.output.outputs.console }} success: description: "Whether files were found." value: ${{ steps.output.outputs.success }} @@ -33,8 +40,17 @@ runs: - name: "Build command." id: command run: | - COMMAND="find '${{ inputs.path }}' ${{ inputs.args }}" + COMMAND="find \"${{ inputs.path }}\" ${{ inputs.additionalArgs }}" echo "command=$COMMAND" >> "$GITHUB_OUTPUT" + + if [[ -n "${{ inputs.name }}" ]]; then + COMMAND="$COMMAND --name \"${{ inputs.name }}\"" + fi + + if [[ -n "${{ inputs.tags }}" ]]; then + COMMAND="$COMMAND --exec \"mc tag list {}\"" + fi + shell: bash - name: "Find file in S3." id: find @@ -54,7 +70,7 @@ runs: if [[ "$RESULT" != "0" ]]; then SUCCESS="false" else - echo "files<> "$GITHUB_OUTPUT" + echo "console<> "$GITHUB_OUTPUT" echo "${{ steps.find.outputs.console }}" >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" SUCCESS="true"