Skip to content

Add href and sha, make pullRequesetId optional #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions automagicallyexecute/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
debug,
getVariable,
setResult,
warning,
getEndpointAuthorizationParameter
} from 'azure-pipelines-task-lib'
import fetch from 'node-fetch'
Expand Down Expand Up @@ -37,15 +38,16 @@ const run = async (): Promise<void> => {
: undefined,
project: getVariable('System.TeamProject'),
repositoryId: getVariable('Build.Repository.ID'),
pullRequestId: getVariable('System.PullRequest.PullRequestId')
pullRequestId: getVariable('System.PullRequest.PullRequestId'),
sha: getVariable('Build.SourceVersion'),
ref: getVariable('Build.SourceBranch')
}

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

Expand Down
4 changes: 2 additions & 2 deletions automagicallyexecute/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"author": "OctoMind GmbH",
"version": {
"Major": 1,
"Minor": 1,
"Patch": 3
"Minor": 2,
"Patch": 0
},
"instanceNameFormat": "Execute Automagically",
"inputs": [
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "automagically-execute-task",
"name": "octomind automagically execute",
"version": "1.1.3",
"version": "1.2.0",
"publisher": "octomind",
"targets": [
{
Expand Down