write-java-properties-file

GitHub Action to write keys=values to a java properties file ☕️

APACHE-2.0 License

Stars
3

Write Java Properties File

GitHub Action to write keys=values to a java .properties file :octocat:

Usage

Simple value

- name: Write simple value to application.properties file
  uses: GuillaumeFalourd/write-java-properties-file@v1
  with:
    file_path: ./src/main/resources/application.properties
    property: property.key
    value: value

Multiline values

- name: Write multiple values to application.properties file
  uses: GuillaumeFalourd/write-java-properties-file@v1
  with:
    file_path: ./src/main/resources/application.properties
    property: |
       first.property.key
       second.property.key
    value: |
       first value
       second value

Action Inputs

Field Mandatory Observation
file_path YES Path to the .properties file.
property YES Property / Properties keys to write.
value YES Value(s) of the given property / properties, in the same order.

Troubleshooting

  • If the action is adding the first key=value at the same line as the last key=value present on the file, add a new empty line to the file before using the action.

  • The action currently doesn't support updating a key-value (PR are welcome!).

Contributing

If you're interested in contributing to this repository, please follow the guidelines

Licensed

This repository uses the Apache License 2.0

Package Rankings
Top 20.79% on Github actions
Badges
Extracted from project README
Action test on Ubuntu Action test on MacOS Action test on Windows