Skip to content

Github Action to generate an output file from a command execution (success or error) πŸ“

License

Notifications You must be signed in to change notification settings

GuillaumeFalourd/command-output-file-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

command-output-file-action

Action test on Ubuntu Action test on MacOS Action test on Windows

title

Github Action to generate an output file from a command execution (success or error) πŸ“


πŸ“š How to use this action?

The actions/checkout is mandatory to use this action, as it will be necessary to access the repository files to get the output file after the action execution.

Field Mandatory Observation
command_line YES ex: ls -lha
output_file_name YES ex: output.txt
display_file_content NO YES (default) or NO

⚠️ NOTES:

  • A command line error won't break the workflow, but just extract the output on the file.
  • You can then access the output file in the directory where you ran the action.

πŸ“ Usage example

WITH output file display on workflow run

    steps:
      - uses: actions/checkout@v2.3.4
      - uses: GuillaumeFalourd/command-output-file-action@v1.1
        with:
          command_line: ls -lha
          output_file_name: output.txt
          display_file_content: YES # this is also the default value if not informed

WITHOUT output file display on workflow run

    steps:
      - uses: actions/checkout@v2.3.4
      - uses: GuillaumeFalourd/command-output-file-action@v1.1
        with:
          command_line: ls -lha
          output_file_name: output.txt
          display_file_content: NO # YES is the default value if not informed

Licensed

This repository uses the Apache License 2.0