Skip to content

Commit

Permalink
fix: defined variable should be a Multi-Job output variable
Browse files Browse the repository at this point in the history
  • Loading branch information
shark300 committed May 9, 2022
1 parent 2756ddd commit 521fb46
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Jira Key Publishing From Multiple Sources

JiraIssueKeyExtractor task extracts Jira Keys from Pull Request's branch name and commits of the build. The extracted
values will be propagated as `JIRA_KEYS` environment variable.
values will be propagated as `Jira.Keys` variable.

## Jira Issue Extractor Azure DevOps Marketplace Extension Details

Expand Down
2 changes: 1 addition & 1 deletion tasks/extractor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function run() {

mainLogger.info("Publishing variable");

tl.setVariable("JIRA_KEYS", jiraKeys);
tl.setVariable("Jira.Keys", jiraKeys, false, true);
} catch (err) {
tl.setResult(tl.TaskResult.Failed, err.message);
}
Expand Down
2 changes: 1 addition & 1 deletion tasks/extractor/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 3
"Patch": 4
},
"instanceNameFormat": "Extract Jira keys",
"inputs": [],
Expand Down
4 changes: 2 additions & 2 deletions tasks/extractor/tests/integration/extractor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("Extract Jira keys", function () {
variableName: string
): string | undefined {
const parseVariableValue = new RegExp(
`##vso\\[task\\.setvariable variable=${variableName};isOutput=false;issecret=false;\\](.*)$`,
`##vso\\[task\\.setvariable variable=${variableName};isOutput=true;issecret=false;\\](.*)$`,
"m"
);
const match = testRunner.stdout.match(parseVariableValue);
Expand All @@ -33,7 +33,7 @@ describe("Extract Jira keys", function () {
expect(tr.succeeded).to.equals(true, "should have succeeded");
expect(tr.warningIssues.length).to.equals(0, "should have no warnings");
expect(tr.errorIssues.length).to.equals(0, "should have no errors");
expect(getVariable(tr, "JIRA_KEYS")).to.equal("JIE-541, JIE-1257");
expect(getVariable(tr, "Jira.Keys")).to.equal("JIE-541, JIE-1257");
console.log(tr.stdout);
done();
});
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": "jira-issue-extractor",
"name": "Jira Issue Extractor",
"version": "1.0.3",
"version": "1.0.4",
"publisher": "AttilaHajdu",
"targets": [
{
Expand Down

0 comments on commit 521fb46

Please sign in to comment.