Skip to content

Conversation

@StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Dec 4, 2019

Fixes #1931
Fixes #1993

Functionality:

  • Detects GitHub Actions as a build server
  • Outputs environment variables to future GitHub Actions build steps

Notes:

  • Unable to set environment variables for current build step.
  • GitHub Actions doesn't have the concept of a build version as I am familiar with it in something like AppVeyor
  • Changed a resharper setting which locates imports in a strange position

Using Documentation from:

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env

@StanleyGoldman StanleyGoldman marked this pull request as ready for review December 4, 2019 16:25
@arturcic
Copy link
Member

arturcic commented Dec 4, 2019

@StanleyGoldman thanks for taking the time to implement, I'll have a look later. One think I did not see is the registration in the DI system. Please add the registration here https://github.com/GitTools/GitVersion/blob/master/src/GitVersionCore/GitVersionCoreModule.cs#L59

@StanleyGoldman
Copy link
Contributor Author

No problem.

@StanleyGoldman
Copy link
Contributor Author

I'm still testing this myself, I'll let you know when I feel confident in it.

@StanleyGoldman
Copy link
Contributor Author

@arturcic I'm ready for your thoughts

@StanleyGoldman
Copy link
Contributor Author

@arturcic Fixed up things after your review

@StanleyGoldman
Copy link
Contributor Author

@arturcic fixed up again 😅

@arturcic
Copy link
Member

Thank you so much for your contributions, @StanleyGoldman. Thanks for the time you spent 👍

@arturcic arturcic merged commit 7ac245b into GitTools:master Dec 18, 2019
{
}

public const string EnvironmentVariableName = "GITHUB_ACTION";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be GITHUB_ACTIONS?

GITHUB_ACTIONS Always set to true when GitHub Actions is running the workflow. You can use this variable to differentiate when tests are being run locally or by GitHub Actions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, are you in a position to send a PR with the fix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure after shallow clone via GitHub actions/checkout@v2 Add Github Actions BuildAgent

3 participants