© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
dreadfullydistinct

MSBuild task that shouldn't run in CI

I've got an MSBuild task which I don't want to run in my pipelines. So I wrote the following:
<Target Name="MissionDesigner" BeforeTargets="AfterBuild" Condition="'$(GITHUB_ACTIONS)' == ''">
    <Exec Command="dotnet run --no-dependencies --project ../DragaliaAPI.MissionDesigner -- ../DragaliaAPI.Shared/Resources/Missions/MissionProgressionInfo.json" ConsoleToMSBuild="true"/>
</Target>
<Target Name="MissionDesigner" BeforeTargets="AfterBuild" Condition="'$(GITHUB_ACTIONS)' == ''">
    <Exec Command="dotnet run --no-dependencies --project ../DragaliaAPI.MissionDesigner -- ../DragaliaAPI.Shared/Resources/Missions/MissionProgressionInfo.json" ConsoleToMSBuild="true"/>
</Target>


because according to github, the
GITHUB_ACTIONS
GITHUB_ACTIONS
env var should always be set by default in CI: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

However, it still seems to run in my pipelines judging by the output. Am I doing something wrong?
GitHub Docs
Variables - GitHub Docs
Variables - GitHub Docs
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Custom msbuild task
C#CC# / help
16mo ago
❔ MSBuild: How to call own Task in the .csproj
C#CC# / help
3y ago
Task.Run() in .net framework
C#CC# / help
13mo ago
✅ [SOLVED] MSBuild Task says file does not exist
C#CC# / help
10mo ago