Skip to content

Commit e4c75d9

Browse files
Add href and sha, make pullRequesetId optional (#19)
* add ref and sha --------- Co-authored-by: Daniel Draper <daniel.draper@octomind.dev>
1 parent 0d285ba commit e4c75d9

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

automagicallyexecute/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
debug,
66
getVariable,
77
setResult,
8+
warning,
89
getEndpointAuthorizationParameter
910
} from 'azure-pipelines-task-lib'
1011
import fetch from 'node-fetch'
@@ -37,15 +38,16 @@ const run = async (): Promise<void> => {
3738
: undefined,
3839
project: getVariable('System.TeamProject'),
3940
repositoryId: getVariable('Build.Repository.ID'),
40-
pullRequestId: getVariable('System.PullRequest.PullRequestId')
41+
pullRequestId: getVariable('System.PullRequest.PullRequestId'),
42+
sha: getVariable('Build.SourceVersion'),
43+
ref: getVariable('Build.SourceBranch')
4144
}
4245

4346
if (!context.pullRequestId) {
44-
setResult(
45-
TaskResult.Failed,
47+
warning(
4648
'System.PullRequest.PullRequestId variable not available. ' +
47-
'Make sure you run this task in a PR build validation pipeline, ' +
48-
'otherwise we cannot comment back the test results'
49+
'Make sure you run this task in a PR build validation pipeline ' +
50+
'if you want to see automatic comments with your test results'
4951
)
5052
}
5153

automagicallyexecute/task.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"author": "OctoMind GmbH",
99
"version": {
1010
"Major": 1,
11-
"Minor": 1,
12-
"Patch": 3
11+
"Minor": 2,
12+
"Patch": 0
1313
},
1414
"instanceNameFormat": "Execute Automagically",
1515
"inputs": [

vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "automagically-execute-task",
44
"name": "octomind automagically execute",
5-
"version": "1.1.3",
5+
"version": "1.2.0",
66
"publisher": "octomind",
77
"targets": [
88
{

0 commit comments

Comments
 (0)