From 65ac3e39a64416d0a6c90ab34de3828745865ad6 Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Mon, 30 Sep 2024 16:13:00 +0530 Subject: [PATCH 1/2] fix: adds environment to entry and query irrespective of Live Preview config --- CHANGELOG.md | 6 ++++++ Contentstack.Core/Models/Entry.cs | 6 +----- Contentstack.Core/Models/Query.cs | 6 ++---- Directory.Build.props | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e263e51..711d3a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version: 2.15.1 +#### Date: Oct-08-2024 + +##### Fix: +- Removed exclusion of env when adding headers + ### Version: 2.15.0 #### Date: Jul-30-2024 diff --git a/Contentstack.Core/Models/Entry.cs b/Contentstack.Core/Models/Entry.cs index 20bed0c..401a7d7 100644 --- a/Contentstack.Core/Models/Entry.cs +++ b/Contentstack.Core/Models/Entry.cs @@ -1380,12 +1380,8 @@ public async Task Fetch() headerAll["authorization"] = this.ContentTypeInstance.StackInstance.LivePreviewConfig.ManagementToken; isLivePreview = true; } - else - { - mainJson.Add("environment", this.ContentTypeInstance.StackInstance.Config.Environment); - } - + mainJson.Add("environment", this.ContentTypeInstance.StackInstance.Config.Environment); foreach (var kvp in UrlQueries) { mainJson.Add(kvp.Key, kvp.Value); diff --git a/Contentstack.Core/Models/Query.cs b/Contentstack.Core/Models/Query.cs index 636ebbd..2710007 100644 --- a/Contentstack.Core/Models/Query.cs +++ b/Contentstack.Core/Models/Query.cs @@ -1851,10 +1851,8 @@ private async Task Exec() headerAll["authorization"] = this.ContentTypeInstance.StackInstance.LivePreviewConfig.ManagementToken; isLivePreview = true; } - else - { - mainJson.Add("environment", this.ContentTypeInstance.StackInstance.Config.Environment); - } + + mainJson.Add("environment", this.ContentTypeInstance.StackInstance.Config.Environment); if (QueryValueJson != null && QueryValueJson.Count > 0) mainJson.Add("query", QueryValueJson); diff --git a/Directory.Build.props b/Directory.Build.props index c39d590..e18626e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,5 @@ - 2.15.0 + 2.15.1 From 4c9cf457e23eb27c8d166c37506e24bef4f15d12 Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Mon, 30 Sep 2024 16:13:53 +0530 Subject: [PATCH 2/2] fix: gh workflow fixed for branches --- .github/workflows/check-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-branch.yml b/.github/workflows/check-branch.yml index 4c087e5..e341da3 100644 --- a/.github/workflows/check-branch.yml +++ b/.github/workflows/check-branch.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Comment PR - if: github.base_ref == 'master' && github.head_ref != 'next' + if: github.base_ref == 'master' && github.head_ref != 'staging' uses: thollander/actions-comment-pull-request@v2 with: message: |