A GitHub Action that reads one or more Java-style .properties files and
exposes every key-value pair as a step output.
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Read config
id: props
uses: ActionCommons/read-properties@v1
with:
files: config/app.properties
- name: Use a value
run: echo "${{ steps.props.outputs['app.version'] }}"- name: Read multiple files
id: props
uses: ActionCommons/read-properties@v1
with:
files: |
config/database.properties
config/app.propertiesThe properties filter applies to every file listed in files.
- name: Read selected properties
id: props
uses: ActionCommons/read-properties@v1
with:
files: |
config/database.properties
config/app.properties
properties: |
db.host
app.version| Input | Required | Description |
|---|---|---|
files |
Yes | Newline-separated list of one or more .properties file paths |
properties |
No | Newline-separated list of property keys to read. When omitted, all properties are read. |
Outputs are set dynamically at runtime as <stem>.<property-key>, where stem
is the filename without its extension.
| Example file | Example property | Output key |
|---|---|---|
config.properties |
db.host |
config.db.host |
app.properties |
version |
app.version |
Because output keys contain dots, use bracket notation:
${{ steps.props.outputs['config.db.host'] }}When two files share the same name (but live in different directories), the first keeps the plain stem and each subsequent file receives a 1-based numeric suffix:
| File | Stem assigned |
|---|---|
env/prod/config.properties |
config |
env/staging/config.properties |
config1 |
env/dev/config.properties |
config2 |
| Feature | Supported |
|---|---|
key=value assignment |
✅ |
key: value (colon separator) |
✅ |
# and ! comment lines |
✅ |
| Backslash line continuation | ✅ |
| Spaces around the separator | ✅ |
= signs inside values |
✅ |
Empty values (key=) |
✅ |
| Windows CRLF line endings | ✅ |
Copy .env.example to .env and set your input values, then run:
npx @github/local-action . src/main.ts .envInput names follow the INPUT_<NAME> convention (hyphens are not converted
to underscores):
# .env
ACTIONS_STEP_DEBUG=true
INPUT_FILES=config/app.properties
INPUT_PROPERTIES=app.versionnpm installUpdate packages to the latest version allowed by the version range specified in
the package.json file.
npm updatenpm auditCheck the registry to see if any of the installed packages have newer versions available.
npm outdatedRemove "extraneous" packages—those that are installed in node_modules but no
longer listed in package.json
npm pruneSimplify the dependency tree by moving duplicated nested dependencies further up the hierarchy.
npm dedupeDisplay an ASCII tree of all installed packages and their dependencies.
npm list (or npm ls)
npm ls -g --depth=0 # to see only top-level global packagesCheck why a specific package is installed by visualizing the dependency chain leading to it.
npm explain <package> (formerly npm why)Run a series of diagnostic tests to ensure the npm installation and environment (like the cache and registry access) are working correctly.
npm doctorClear the internal npm cache, which can resolve "ghost" installation errors.
npm cache clean --forcePerform a "clean" install by deleting node_modules and strictly following the
package-lock.json file (Designed for CI environments).
npm ciCreate a symbolic link for a package being developed locally, allowing use in another project as if it were published.
npm linkPrint detailed metadata about a package from the registry without installing it, such as available versions or its documentation.
npm view <package-name>