Skip to content

GuillaumeFalourd/write-java-properties-file

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

Repository files navigation

Write Java Properties File

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

☞ 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