name: ikdasm-files
description: "Run ikdasm to disassemble .NET assemblies in a folder."
inputs:
  directory:
    description: "Directory to search."
    required: true
    default: '.'
  pattern:
    description: "Pattern of files to search for."
    required: true
    default: '*.dll'
  extension:
    description: "Extension of the disassembly files. Default: .dasm"
    required: true
    default: '.dasm'
  deleteAssemblies:
    description: "Whether or not the assemblies should be deleted afterwards."
    required: false
    default: "false"
  removeComments:
    description: "Whether or not the lines starting with // should be removed from the disassembled files."
    required: false
    default: "false"
  catchErrors:
    description: "Whether or not errors should be handled."
    required: false
outputs:
  console:
    description: "The console output of the command."
    value: ${{ steps.ikdasm.outputs.console }}
runs:
  using: 'composite'
  steps:
  - name: "Make temporary file of script."
    id: script
    uses: act/common/utils/mktemp@master
    with:
      input: ${{ github.action_path }}/disassemble_files.sh
      tmpDir: .
  - name: "Run ikdasm script."
    id: ikdasm
    uses: act/common/mono/mono@master
    env:
      DASM_EXTENSION: ${{ inputs.extension }}
    with:
      program: bash
      command: ${{ steps.script.outputs.tmp }} "${{ inputs.directory }}" "${{ inputs.pattern }}" ${{ inputs.deleteAssemblies }} ${{ inputs.removeComments }}
      catchErrors: ${{ inputs.catchErrors }}
  