Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
Rollback output variables (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
qetza committed Feb 19, 2021
1 parent 3d5fa0f commit c036ca3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 36 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ The parameters of the task are described bellow, in parenthesis is the YAML name
- **Variable separator** (variableSeparator): the separtor to use in variable names for nested objects and arrays in variable files. Example: `{ 'My': { 'Value': ['Hello World!'] } }` will create a variable _My.Value.0_ with the value _Hello World!_.
- **Send anonymous usage telemetry** (enableTelemetry): if checked anonymous usage data (hashed collection and pipeline id, no file parameter values, no variable values) will be sent to the task author only to analyze task usage.

### Output variables
The task creates the following as output variables:
- **tokenReplacedCount**: the total number of tokens which were replaced by a variable.
- **tokenFoundCount**: the total number of of tokens which were found.
- **fileProcessedCount**: the total number of files which were processed.
- **transformExecutedCount**: the total number of transformations which were executed.
- **defaultValueCount**: the total number of default value used.

## Data/Telemetry
The Replace Tokens task for Azure Pipelines collects anonymous usage data and sends them to its author to help improve the product. If you don’t wish to send usage data, you can change your telemetry settings through _Send anonymous usage telemetry_ parameter or by setting a variable or environment variable `REPLACE_TOKENS_DISABLE_TELEMETRY` to `true`.

Expand All @@ -88,6 +80,7 @@ If you want to use tokens in XML based configuration files to be replaced during
## Release notes
**New in 3.7.1**
- Fix issue on binary files ([#193](https://github.com/qetza/vsts-replacetokens-task/issues/193)).
- Rollback output variables ([#196](https://github.com/qetza/vsts-replacetokens-task/issues/196)).

**New in 3.7.0**
- Add output variables _tokenReplacedCount_, _tokenFoundCount_ and _fileProcessedCount_ ([#160](https://github.com/qetza/vsts-replacetokens-task/issues/160)).
Expand Down
6 changes: 0 additions & 6 deletions task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,12 +663,6 @@ async function run() {
});

// display summary
tl.setVariable('tokenReplacedCount', globalCounters.Replaced.toString());
tl.setVariable('tokenFoundCount', globalCounters.Tokens.toString());
tl.setVariable('fileProcessedCount', globalCounters.Files.toString());
tl.setVariable('transformExecutedCount', globalCounters.Transforms.toString());
tl.setVariable('defaultValueCount', globalCounters.DefaultValues.toString());

let duration = (+new Date() - (+startTime)) / 1000;
logger.info('replaced ' + globalCounters.Replaced + ' tokens out of ' + globalCounters.Tokens + (globalCounters.DefaultValues ? ' (using ' + globalCounters.DefaultValues + ' default value(s))' : '') + (options.enableTransforms ? ' and running ' + globalCounters.Transforms + ' functions' : '') + ' in ' + globalCounters.Files + ' file(s) in ' + duration + ' seconds.');

Expand Down
22 changes: 0 additions & 22 deletions task/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,28 +239,6 @@
"helpMarkDown": "If checked anonymous usage data will be sent to the task author for task usage analysis."
}
],
"outputVariables": [
{
"name": "tokenReplacedCount",
"description": "Total number of tokens replaced."
},
{
"name": "tokenFoundCount",
"description": "Total number of tokens found."
},
{
"name": "fileProcessedCount",
"description": "Total number of files processed."
},
{
"name": "transformExecutedCount",
"description": "Total number of transformations executed."
},
{
"name": "defaultValueCount",
"description": "Total number of default value used."
}
],
"execution": {
"Node": {
"target": "index.js"
Expand Down

0 comments on commit c036ca3

Please sign in to comment.