question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Cannot use output parameter due to it being hardcoded by task

See original GitHub issue

Moved from https://github.com/GitTools/GitVersion/issues/2473

Describe the bug Running gitversion with /output file parameter gets overwritten. Actually it gets overwritten twice with two different parameters - json and buildserver.

C:\hostedtoolcache\windows\GitVersion.Tool\5.5.1\x64\dotnet-gitversion.exe D:/a/1/s /output json /output buildserver /config /output file

Expected Behavior

Being able to specify intended output, perhaps as parameter

Actual Behavior

buildserver output type gets precedence over both json and file outputs

Possible Fix

Expose output as parameter

Steps to Reproduce

Create task that will save GitVersion.json file using /output file parameter

Context

I’m not able to create json artifact to reuse it in other jobs

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chris-codeflowcommented, Jan 25, 2021

Hello @quasarea. I forgot to say thanks for the info on the default file name (GitVersion.json).

1reaction
chris-codeflowcommented, Jan 25, 2021

Hello @quasarea. I just ran a GitHub actions test to verify the above. It all worked as expected (it created output variables in JSON format, it created outputs for the GitHub build agent and it output the version variables to a specified file, which I proved by displaying the contents of the file in a separate step.

Snippet from action:

- name: Output version to file
  uses: gittools/actions/gitversion/execute@v0.9.8
  with:
    additionalArguments: '/output file /outputfile ./SemVer.json'

- name: Display version from file
  run: |
    cat ./SemVer.json

See GitHub workflow file for full details.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When using input parameters, output string ... - GitHub
Given a task that writes a string to some file and then returns that string as an output parameter, if non-hardcoded input parameters...
Read more >
Unable to pass output parameters from one workflowTemplate ...
For example, the no-parameters template here does not produce an output, even though it invokes a template which does have an output.
Read more >
Difference between Connector tab Output parameter vs Input ...
So you need to make it available as a process variable in the calling process instance (process instance with two service tasks). Output...
Read more >
Cannot use result map service because output parameter ...
The result map service used to draw the results of a task requires output to be written to disk. It cannot be written...
Read more >
in and out variables - whats the difference - Ask TOM
5/2 PLS-00363: expression 'X' cannot be used as an assignment target 5/2 PL/SQL: Statement ignored. An IN OUT parameter can not only be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found