Skip to content

Commit 55db3e2

Browse files
committed
Initial commit
1 parent 372833f commit 55db3e2

File tree

2 files changed

+40
-7
lines changed

2 files changed

+40
-7
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,23 @@ when using this trigger.**
148148
Instructions on using the action within Azure Pipelines can be found
149149
[here][azurepipelinestask].
150150

151+
## Git History
152+
153+
Depending on the nature of your repo history, it may be necessary to fetch Git
154+
history during checkout. This can be done by updating the `actions/checkout`
155+
step:
156+
157+
```YAML
158+
- uses: actions/[email protected]
159+
fetch-depth: 0
160+
```
161+
162+
In many cases, `fetch-depth` will not be required so it is recommended not to
163+
set this unless the task explicitly requests it. It may also be possible to set
164+
this to a value greater than 0 if you only require a partial history, but it can
165+
be difficult to determine a value that will work consistently, due to the nature
166+
of Git history.
167+
151168
## Troubleshooting
152169

153170
A set of steps for troubleshooting any issues encountered can be found

docs/azure-pipelines-task.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,31 @@ You can use a name other than `PR_Metrics_Access_Token` if you wish, but you
9494
will need to keep the name unified across the variable and task definitions. The
9595
name `PR_METRICS_ACCESS_TOKEN` cannot be altered.
9696

97-
## Always Close Comment
97+
## Git History
98+
99+
Depending on the nature of your repo history, it may be necessary to fetch Git
100+
history during checkout. This can be done by updating the `checkout` step:
101+
102+
```YAML
103+
- checkout: self
104+
fetchDepth: 0
105+
```
106+
107+
Alternatively, if using classic pipelines, you can disable 'Shallow fetch' under
108+
the build process phase settings.
98109

99-
The `AlwaysCloseComment` option is not available for GitHub PRs as the main size
100-
and test comment there cannot be open by default.
110+
In many cases, `fetchDepth` will not be required so it is recommended not to set
111+
this unless the task explicitly requests it. It may also be possible to set this
112+
to a value greater than 0 if you only require a partial history, but it can be
113+
difficult to determine a value that will work consistently, due to the nature of
114+
Git history.
115+
116+
## Always Close Comment
101117

102-
By default in Azure DevOps, the comment is left open if it requires further
103-
attention, such as when a smaller PR or increased test coverage is suggested. If
104-
this input is set to `true`, the comment will be closed, to prevent it blocking
105-
automatic closure of the PR.
118+
By default, the comment is left open if it requires further attention, such as
119+
when a smaller PR or increased test coverage is suggested. If the
120+
`AlwaysCloseComment` option is set to `true`, the comment will be closed, to
121+
prevent it blocking automatic closure of the PR.
106122

107123
[addingtask]: https://docs.microsoft.com/azure/devops/pipelines/customize-pipeline
108124
[workloadidentityfederation]: workload-identity-federation.md

0 commit comments

Comments
 (0)