Skip to content
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

Add GitSha override when building #114

Closed
yunj opened this issue Jul 8, 2020 · 1 comment
Closed

Add GitSha override when building #114

yunj opened this issue Jul 8, 2020 · 1 comment

Comments

@yunj
Copy link

yunj commented Jul 8, 2020

GitInfo.targets has several properties which can be overridden from command line when running MSBUILD, for example, GitCommits. I am wondering if it's feasible to override GitSha, the full version of commit? Our test does not care about the value of SHA as long as it is valid. Thanks.

</PropertyGroup>
  <!-- Defaults if overrides are specified when building -->
  <GitCommits Condition="'$(GitCommits)' == ''">0</GitCommits>
</PropertyGroup>
@kzu
Copy link
Member

kzu commented Sep 20, 2020

You can already do that. Just provide a GitDefaultCommit or even an entirely made-up GitCommit and the target that calculates it won't even run.

For example, just set this on your project:

<Project>
   <ProjectGroup>
      <GitCommit>asdfasdf</GitCommit>

HTH

@kzu kzu closed this as completed Sep 20, 2020
@devlooped devlooped locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants