Skip to content

Commit

Permalink
Merge branch 'release/0.27.0'
Browse files Browse the repository at this point in the history
* release/0.27.0:
  (#145) Enable skipping of Yarn analysis
  (maint) synced local '.templates/' with remote '.github/GitReleaseManager/.templates/'
  (maint) Remove unnecessary comma from output
  (build) Switch to deleting old labels
  (maint) created local '.github/workflows/label-sync.yml' from remote '.github/workflows/label-sync.yml'
  • Loading branch information
gep13 committed Apr 26, 2024
2 parents 9745f43 + ba471f2 commit 8ed343d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Sync labels
on:
workflow_dispatch:
schedule:
# Run at the end of the day (most likely UTC)
- cron: "0 0 * * *"

jobs:
labels:
# We use ubuntu as the image, as it is typically faster and cheaper (on private repos).
runs-on: ubuntu-latest

steps:
# uncomment the uses line if additional configuration in the current
# repository is used.
#- uses: actions/[email protected]
- uses: EndBug/[email protected]
with:
config-file: |
https://raw.githubusercontent.com/chocolatey/.github/main/.github/labels.yml
request-token: ${{ secrets.SYNC_TOKEN }} # Used when getting the config files.
delete-other-labels: true # After initial run, and verification change this to true
dry-run: false
token: ${{ secrets.SYNC_TOKEN }} # Used when updating the labels on the repository.
2 changes: 1 addition & 1 deletion Chocolatey.Cake.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Setup<BuildData>(context =>
);
});

Information("Building version {0} of " + BuildParameters.Title + " ({1}, {2}) using version {3} of Cake, , and version {4} of Chocolatey.Cake.Recipe. (IsTagged: {5})",
Information("Building version {0} of " + BuildParameters.Title + " ({1}, {2}) using version {3} of Cake, and version {4} of Chocolatey.Cake.Recipe. (IsTagged: {5})",
BuildParameters.Version.PackageVersion,
BuildParameters.Configuration,
BuildParameters.Target,
Expand Down
9 changes: 9 additions & 0 deletions Chocolatey.Cake.Recipe/Content/dependencyCheck.cake
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ BuildParameters.Tasks.DependencyCheckTask = Task("Dependency-Check")

DeleteFile(BuildParameters.RootDirectoryPath.CombineWithFilePath("dependency-check.zip"));

if (ToolSettings.DependencyCheckDisableYarnAudit)
{
ReplaceTextInFiles(
BuildParameters.RootDirectoryPath.Combine("tools/DependencyCheck.Runner.Tool.3.2.1/tools/bin").CombineWithFilePath("dependency-check.bat").ToString(),
"org.owasp.dependencycheck.App %CMD_LINE_ARGS%",
"org.owasp.dependencycheck.App --disableYarnAudit %CMD_LINE_ARGS%"
);
};

var DependencyCheckSettings = new DependencyCheckSettings {
Project = BuildParameters.ProductName,
Scan = BuildParameters.SourceDirectoryPath.FullPath,
Expand Down
11 changes: 10 additions & 1 deletion Chocolatey.Cake.Recipe/Content/toolsettings.cake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class ToolSettings
public static FilePath EazfuscatorToolLocation { get; private set; }
public static string AmazonLambdaGlobalTool { get; private set; }
public static string DependencyCheckTool { get; private set; }
public static bool DependencyCheckDisableYarnAudit { get; private set; }
public static string DotNetFormatGlobalTool { get; private set; }
public static string GitVersionGlobalTool { get; private set; }
public static string GitVersionTool { get; private set; }
Expand Down Expand Up @@ -109,7 +110,8 @@ public static class ToolSettings
List<string> scriptAnalyzerExcludePaths = null,
string testCoverageExcludeByAttribute = null,
string testCoverageExcludeByFile = null,
string testCoverageFilter = null
string testCoverageFilter = null,
bool dependencyCheckDisableYarnAudit = false
)
{
context.Information("Setting up tools...");
Expand All @@ -125,6 +127,13 @@ public static class ToolSettings
TestCoverageExcludeByFile = testCoverageExcludeByFile ?? "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs";
TestCoverageFilter = testCoverageFilter ?? string.Format("+[{0}*]* +[{1}*]* -[*.tests]* -[*.Tests]*", BuildParameters.Title, BuildParameters.Title.ToLowerInvariant());

DependencyCheckDisableYarnAudit = dependencyCheckDisableYarnAudit;

if (context.HasArgument("dependencyCheckDisableYarnAudit"))
{
DependencyCheckDisableYarnAudit = context.Argument<bool>("dependencyCheckDisableYarnAudit");
}

// We only use MSBuild when running on Windows. Elsewhere, we use XBuild when required. As a result,
// we only need to detect the correct version of MSBuild when running on WIndows, and when it hasn't
// been explicitly set.
Expand Down

0 comments on commit 8ed343d

Please sign in to comment.