Skip to content

Commit

Permalink
Add YAML variable files (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
qetza authored Mar 10, 2024
1 parent 8368fa6 commit d9dd3e9
Show file tree
Hide file tree
Showing 15 changed files with 4,253 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
${{ toJSON(secrets) }},
{ "VAR2": "#{inline}#value2", "inline": "inline_" },
${{ toJSON(format('@{0}/tests/data/vars.jsonc', github.workspace)) }},
"@**/*.json;!**/settings*",
"@**/*.(json|yml);!**/settings*",
"$ENV_VARS"
]
root: ${{ github.workspace }}/tests
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v1.1.0
- Add support for JSON comments in _variables_ and in JSON variable files and environment variables
- Add support for multiple glob patterns separeted by a semi-colon (`;`) using [fast-glob](https://github.com/mrmlnc/fast-glob) in variable file paths
- Add support for YAML variable files (`.yml` or `.yaml`)

## v1.0.0
- Initial Release of the ReplaceTokens action
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

The MIT License (MIT)

Copyright (c) 2024 Guillaume ROUCHON
Copyright (c) 2024-present Guillaume ROUCHON

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This GitHub Action replaces tokens in text files with variables and/or secrets.

## What's new
Please refer to the [release page](https://github.com/qetza/replacetokens-action/releases) for the latest release notes.
Please refer to the [release page](https://github.com/qetza/replacetokens-action/releases/latest) for the latest release notes.

## Usage
### Inputs
Expand All @@ -31,7 +31,7 @@ Please refer to the [release page](https://github.com/qetza/replacetokens-action
# The object can be:
# - an object: properties will be parsed as key/value pairs
# - a string starting with '@': value is parsed as multiple glob patterns separated
# by a semi-colon ';' using fast-glob syntax to JSON files
# by a semi-colon ';' using fast-glob syntax to JSON or YAML files
# - a string starting with '$': value is parsed as an environment variable name
# containing JSON encoded key/value pairs
# - an array: each item must be an object or a string and will be parsed as
Expand Down Expand Up @@ -236,7 +236,8 @@ Please refer to the [release page](https://github.com/qetza/replacetokens-action
${{ toJSON(vars) }}, # variables
${{ toJSON(secrets) }}, # secrets
${{ toJSON(format('@{0}/settings.json', github.workspace)) }}, # read from file
"@**/vars.(json|jsonc);!**/local/*" # read from files
"@**/vars.(json|jsonc);!**/local/*" # read from JSON files
"@**/settings.(yml|yaml);!**/local/*" # read from YAML files
"$ENV_VARS", # read from env
{ "VAR2": "${{ github.event.inputs.var2 }}" } # inline values
]
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ inputs:
The object can be:
- an object: properties will be parsed as key/value pairs
- a string starting with '@': value is parsed as multiple glob patterns separated
by a semi-colon ';' using fast-glob syntax to JSON files
by a semi-colon ';' using fast-glob syntax to JSON or YAML files
- a string starting with '$': value is parsed as an environment variable name
containing JSON encoded key/value pairs
- an array: each item must be an object or a string and will be parsed as specified
Expand Down
Loading

0 comments on commit d9dd3e9

Please sign in to comment.