Skip to content

Commit

Permalink
Documentation: Adding Classic Azure DevOps details (#471)
Browse files Browse the repository at this point in the history
There is a lack of documentation about how to set up PR Metrics using classic (UI) pipelines in Azure DevOps, which can cause confusion, particularly around gaining access to secrets. This change adds the relevant information, making it easier for people to set this up.
  • Loading branch information
muiriswoulfe committed Mar 4, 2024
1 parent 8dcb997 commit 117eda8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/azure-pipelines-task.md
Expand Up @@ -66,6 +66,29 @@ steps:
continueOnError: true
```

## Classic Pipelines

For classic pipelines, you need to specify the secret as an environment
variable.

First, create a new environment variable in the pipeline definition under the
variables tab with the name `PR_Metrics_Access_Token` and the value of the PAT
as outlined above. Mark the variable as a secret to ensure it is not exposed in
the logs.

![Screenshot of the variable definition](images/variable-definition.png)

Then, add the task to the pipeline and expose the secret as an environment
variable. To do this, expand the "Environment Variables" section and press "+"
to add a new variable. In the first text box, add `PR_METRICS_ACCESS_TOKEN` and
in the second, add `$(PR_Metrics_Access_Token)`.

![Screenshot of the task definition](images/task-definition.png)

You can use a name other than `PR_Metrics_Access_Token` if you wish, but you
will need to keep the name unified across the variable and task definitions. The
name `PR_METRICS_ACCESS_TOKEN` cannot be altered.

## Always Close Comment

The `AlwaysCloseComment` option is not available for GitHub PRs as the main size
Expand Down
Binary file added docs/images/task-definition.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/variable-definition.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 117eda8

Please sign in to comment.