diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ed38ba7..58d665b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'csharp', 'javascript' ] + language: [ 'csharp' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support diff --git a/.github/workflows/sca-scan.yml b/.github/workflows/sca-scan.yml index f09161f..47c3845 100644 --- a/.github/workflows/sca-scan.yml +++ b/.github/workflows/sca-scan.yml @@ -6,10 +6,18 @@ jobs: security-sca: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - name: Checkout repository + uses: actions/checkout@master + - name: Setup .NET Core @ Latest + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "7.0.x" + - name: Run Dotnet Restore + run: | + dotnet restore - name: Run Snyk to check for vulnerabilities - uses: snyk/actions/node@master + uses: snyk/actions/dotnet@master env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} with: - args: --all-projects --fail-on=all + args: --file=contentstack-liquid-template-example/obj/project.assets.json --fail-on=all diff --git a/LICENSE b/LICENSE index f470f33..bcbfb04 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2012-2022 Contentstack (http://app.contentstack.com) +Copyright (c) 2012-2026 Contentstack (http://app.contentstack.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/contentstack-liquid-template-example/Controllers/HomeController.cs b/contentstack-liquid-template-example/Controllers/HomeController.cs index f74f7af..7ffc623 100644 --- a/contentstack-liquid-template-example/Controllers/HomeController.cs +++ b/contentstack-liquid-template-example/Controllers/HomeController.cs @@ -6,33 +6,36 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using contentstack_liquid_template_example.Models; -using Contentstack.Core; -using Contentstack.Core.Models; -using System.IO; - +using Contentstack.Core; +using Contentstack.Core.Models; +using System.IO; + namespace contentstack_liquid_template_example.Controllers { public class HomeController : Controller - { - private readonly ContentstackClient _stack; - public HomeController(ContentstackClient stack) => _stack = stack; + { + private readonly ContentstackClient _stack; + public HomeController(ContentstackClient stack) => _stack = stack; + [HttpGet] public async Task Index() - { - string result = string.Empty; - var query = _stack.ContentType("product").Query(); - ContentstackCollection products = await query.Find(); - var fileString = System.IO.File.ReadAllText(Path.GetFullPath("Views/Home/home.liquid")); - var template = Template.Parse(fileString); - result = template.Render(new { Products = products.Items }); - return View("Index", result); + { + string result = string.Empty; + var query = _stack.ContentType("product").Query(); + ContentstackCollection products = await query.Find(); + var fileString = System.IO.File.ReadAllText(Path.GetFullPath("Views/Home/home.liquid")); + var template = Template.Parse(fileString); + result = template.Render(new { Products = products.Items }); + return View("Index", result); } + [HttpGet] public IActionResult Privacy() { return View(); } + [HttpGet] [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { diff --git a/contentstack-liquid-template-example/Controllers/ProductController.cs b/contentstack-liquid-template-example/Controllers/ProductController.cs index 75db14c..f3a3f77 100644 --- a/contentstack-liquid-template-example/Controllers/ProductController.cs +++ b/contentstack-liquid-template-example/Controllers/ProductController.cs @@ -19,6 +19,7 @@ public class ProductController : Controller public ProductController(ContentstackClient stack) => _stack = stack; // GET: // + [HttpGet] public IActionResult Index() { return View();