@@ -44,6 +44,7 @@ inputs:
4444 description : ' Remove build metadata suffix from source version'
4545 required : false
4646 default : ' true'
47+
4748 # Build metadata
4849 release-version-generate-build-metadata :
4950 description : ' Put build metadata (release date, commit sha, etc.) into result RELEASE_VERSION'
@@ -66,7 +67,6 @@ inputs:
6667 description : ' A time stamp in ISO format to put into a build metadata string, by default the action uses current time in UTC timezone'
6768 required : false
6869
69-
7070 # Next version
7171 next-version-increment-major :
7272 description : ' Increment major version in result NEXT_VERSION, resets all other versions to "0" and prerelease to "1" if found'
@@ -99,6 +99,51 @@ inputs:
9999 required : false
100100 default : ' false'
101101
102+ # Other stuff
103+ data-extract :
104+ required : false
105+ default : ' false'
106+ description : |
107+ Enable data extraction mechanism.
108+
109+ Example:
110+ data-extract: true
111+ data-extract-name: 'first_variable'
112+ data-extract-paths: '/path/to/file'
113+ data-extract-patterns: '/(?<=variable.name=).+/i'
114+
115+ There are several use cases depending on RegEx format and flags:
116+ * RegEx Match only - As on example, above. Variable name in 'data-extract-name' parameter will be used 'as is',
117+ variable value will be set on matched text. Extraction will fail if 'data-extract-name' is not set.
118+ * One group - Variable name in 'data-extract-name' parameter will be used 'as is', variable value will be set on
119+ group value. Extraction will fail if 'data-extract-name' is not set.
120+ * Two or more groups - If 'data-extract-name' value is set then the first group will be used as value, and other
121+ groups will be ignored, if it's not set, then the first group will used as variable name and the second group
122+ will be used as value.
123+ * Multiple match (multiple RegEx, 'g' flag in RegEx is set, etc) - If 'data-extract-name' value is set the action
124+ will extract all RegEx matches and export variables with underscore and variable index as suffix, except the
125+ first one.
126+ E.G.: first_variable -> FIRST_VARIABLE, FIRST_VARIABLE_1, etc; If 'data-extract-name' value is not set then
127+ two groups in every RegEx is a requirement, the first group will used as variable name and the second group will
128+ be used as value. If multiple files have the same variable names, output values will be overwritten with the
129+ latter matches.
130+
131+ Variable name convert rules:
132+ * Spaces and symbols '-', even multiple in a row, will be converted to single symbol '_';
133+ * Other special characters except digits and letters will be cut off;
134+ * The variable name will be converted to upper case.
135+ data-extract-name :
136+ required : false
137+ description : |
138+ Variable name to which extracted data will be placed, standard variable name conversion rules are also applied to
139+ this field. If not set it will be extracted from RegEx groups. See usage use cases above.
140+ data-extract-paths :
141+ required : false
142+ description : ' Semicolon (";") separated path list of files which to use to extract data'
143+ data-extract-patterns :
144+ required : false
145+ description : ' Semicolon (";") separated RegEx pattern list wrapped with "/" symbols, with flags'
146+
102147outputs :
103148 CURRENT_VERSION :
104149 description : ' A version grabbed from a variable or a file without any changes'
0 commit comments