You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes when generating change notes it becomes useful to include data that is not present in the source code and is only known at build time while generating the change log. An example might be a build number that is generated by a CI/CD build server.
It would be nice to be able to pass variables into the changelog templates as command-line arguments:
a slice of string --arg name value flags similar to jq (e.g. --arg build_number 123)
--arg name value
This option passes a value to the jq program as a predefined variable. If you run jq with --arg foo bar, then $foo is available in the program and has the value "bar".
--arg-json '{"build_number": 123}'
--arg-file /path/to/args.json
where /path/to/args.json looks like this
{
"build_number": 123
}
in all cases the accumulated key/value pairs could be made available to the template as a map[string]interface and accessed via the index template function
{{ index .Args "build_number" }}
If this request is aligned with the direction of this project I would be happy to contribute a pull request.
The text was updated successfully, but these errors were encountered:
davidalpert
added a commit
to davidalpert/git-chglog
that referenced
this issue
Nov 28, 2023
this commit addresses git-chglog#261 by allowing the passing of
arbitrary key=value arguments into the command line
and exposing them as part of RenderData for use
in the templates
resolves: git-chglog#261
davidalpert
added a commit
to davidalpert/git-chglog
that referenced
this issue
Nov 28, 2023
this commit addresses git-chglog#261 by allowing the passing of
arbitrary key=value arguments into the command line
and exposing them as part of RenderData for use
in the templates
resolves: git-chglog#261
Sometimes when generating change notes it becomes useful to include data that is not present in the source code and is only known at build time while generating the change log. An example might be a build number that is generated by a CI/CD build server.
It would be nice to be able to pass variables into the changelog templates as command-line arguments:
a slice of string
--arg name value
flags similar tojq
(e.g.--arg build_number 123
)--arg-json '{"build_number": 123}'
--arg-file /path/to/args.json
where
/path/to/args.json
looks like thisin all cases the accumulated key/value pairs could be made available to the template as a
map[string]interface
and accessed via theindex
template functionIf this request is aligned with the direction of this project I would be happy to contribute a pull request.
The text was updated successfully, but these errors were encountered: