From 3f8162ec20aeb2fa21581603699d3f2591d43c95 Mon Sep 17 00:00:00 2001 From: Ral G <39119258+ralongit@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:44:47 +0300 Subject: [PATCH] Fix workflow permissions and Helm template condition (#181) - Change GH_TOKEN to GITHUB_TOKEN - Specified job permissions for the token - Upgraded release work actions version to v4 - Updated LogzioRegion condition for helm template --- .github/workflows/create-release.yml | 12 +++++++++--- config-templates/helm.json | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index c4444415b..b74e30b57 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -17,11 +17,17 @@ jobs: update_version: name: Update Version runs-on: macos-latest + permissions: + contents: write # Allows pushing changes to the repository + issues: write # Allows creating issues + packages: write # Allows accessing and publishing packages + pull-requests: write # Allows creating and managing pull requests + actions: write # Allows updating GitHub Action workflows steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Increase Version run: | version=$(cat ./version | grep -o -e '[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}') @@ -63,7 +69,7 @@ jobs: needs: update_version steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Update version file run: | echo "${{ needs.update_version.outputs.VERSION }}" >./version diff --git a/config-templates/helm.json b/config-templates/helm.json index 24c43751f..23adf795a 100644 --- a/config-templates/helm.json +++ b/config-templates/helm.json @@ -27,7 +27,7 @@ "targetElement": "datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS' || @.type=='TRACING')]", "conditionalTemplates": [ { - "condition": "(@['telemetries'][?(@['type']=='TRACING')].length > 0) || (@['telemetries'][?(@['type']=='METRICS')].params[?(@['name']=='isObjectLogs')].value == true)", + "condition": "(datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')]) || (datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='TRACING')] && datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isObjectLogs')].value)", "template": " --set logzio-k8s-telemetry.secrets.LogzioRegion='<>' \\" } ]