Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
package

GitHub Action

Write File

v1.0

Write File

package

Write File

Write a file

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Write File

uses: DamianReeves/[email protected]

Learn more about this action in DamianReeves/write-file-action

Choose a version

Write File Action

This action writes a file.

Inputs

path

Required The path to the file to write.

contents

Required The contents of the file.

write-mode

Optional The mode of writing to use: overwrite, append, or preserve.

Modes:

  • overwrite - overwrite the file if it exists
  • append - if the file exists, it will be appended to
  • preserve - if the file already exists the contents will not be written to

Default append

Outputs

size

Returns the file size.

Example usage

uses: DamianReeves/write-file-action
with:
  path: ${{ env.home}}/.bashrc
  contents: |
    echo "Hello World!"
  write-mode: append