https://github.com/guillaumefalourd/write-java-properties-file
GitHub Action to write keys=values to a java properties file ☕️ :octocat:
https://github.com/guillaumefalourd/write-java-properties-file
all-os-supported github-actions java properties-files
Last synced: 7 months ago
JSON representation
GitHub Action to write keys=values to a java properties file ☕️ :octocat:
- Host: GitHub
- URL: https://github.com/guillaumefalourd/write-java-properties-file
- Owner: GuillaumeFalourd
- License: apache-2.0
- Created: 2022-11-02T16:33:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T11:14:39.000Z (almost 2 years ago)
- Last Synced: 2025-01-23T10:44:17.734Z (9 months ago)
- Topics: all-os-supported, github-actions, java, properties-files
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Write Java Properties File
[](https://github.com/GuillaumeFalourd/write-java-properties-file/actions/workflows/ubuntu_action_test.yml) [](https://github.com/GuillaumeFalourd/write-java-properties-file/actions/workflows/macos_action_test.yml) [](https://github.com/GuillaumeFalourd/write-java-properties-file/actions/workflows/windows_action_test.yml)
☞ GitHub Action to write keys=values to a java `.properties` file ☕️ :octocat:
## 📚 Usage
### Simple value
```yaml
- 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
```yaml
- 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](https://github.com/GuillaumeFalourd/write-java-properties-file/blob/main/CONTRIBUTING.md)
## 🏅 Licensed
☞ This repository uses the [Apache License 2.0](https://github.com/GuillaumeFalourd/write-java-properties-file/blob/main/LICENSE)