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

MINOR FOUNDATIONS: Updated YAML scripts to exclude linter tasks for Push Events #131

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out
Expand All @@ -28,6 +29,7 @@ jobs:
- name: Test
run: dotnet test --no-build --verbosity normal
add_tag:
name: Add Tag and Create Release
runs-on: ubuntu-latest
needs:
- build
Expand Down Expand Up @@ -109,6 +111,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAT_FOR_TAGGING }}
publish:
name: Publish to NuGet
runs-on: ubuntu-latest
needs:
- add_tag
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/prLinter.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: PR Linter
on:
push:
branches:
- main
pull_request:
types:
- opened
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public void GenerateBuildScript(string branchName, string projectName, string do
"build",
new Job
{
Name = "Build",
RunsOn = BuildMachines.UbuntuLatest,

Steps = new List<GithubTask>
Expand Down Expand Up @@ -87,6 +88,9 @@ public void GenerateBuildScript(string branchName, string projectName, string do
projectRelativePath: "ADotNet/ADotNet.csproj",
githubToken: "${{ secrets.PAT_FOR_TAGGING }}",
branchName: branchName)
{
Name = "Add Tag and Create Release"
}
},
{
"publish",
Expand All @@ -95,6 +99,9 @@ public void GenerateBuildScript(string branchName, string projectName, string do
dependsOn: "add_tag",
dotNetVersion: dotNetVersion,
nugetApiKey: "${{ secrets.NUGET_ACCESS }}")
{
Name = "Publish to NuGet"
}
}
}
};
Expand All @@ -120,8 +127,6 @@ public void GeneratePrLintScript(string branchName)

OnEvents = new Events
{
Push = new PushEvent { Branches = [branchName] },

PullRequest = new PullRequestEvent
{
Types = ["opened", "edited", "synchronize", "reopened", "closed"],
Expand Down
3 changes: 2 additions & 1 deletion ADotNet/Models/Pipelines/GithubPipelines/DotNets/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets
{
public class Events
{
[YamlMember(DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public PushEvent Push { get; set; }

[YamlMember(Alias = "pull_request")]
[YamlMember(Alias = "pull_request", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public PullRequestEvent PullRequest { get; set; }
}
}
Loading