Skip to content

automated release for helm chart#335

Draft
Rupam-It wants to merge 1 commit into
mainfrom
rupam/ci-fix
Draft

automated release for helm chart#335
Rupam-It wants to merge 1 commit into
mainfrom
rupam/ci-fix

Conversation

@Rupam-It
Copy link
Copy Markdown
Contributor

@Rupam-It Rupam-It commented Mar 20, 2026

this CI changes make sure to release the helm chart whenever there is a helm chart , it will automatically make a release !


Summary by Gitar

  • CI workflows for Helm chart automation:
    • Added helm-auto-release.yml to automatically release zxporter chart on changes, bumping patch version and pushing to Docker Hub OCI registry
    • Added helm-auto-release-netmon.yml to automatically release zxporter-netmon chart with same automation pattern
    • Added helm-chart-validation.yml to lint and template-render both charts on pull requests

This will update automatically on new commits.

Comment on lines +12 to +38
name: Lint & template zxporter chart
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: '3.12.3'

- name: Update chart dependencies
run: helm dependency update helm-chart/zxporter

- name: Lint chart
run: helm lint helm-chart/zxporter

- name: Template render check
run: |
helm template zxporter helm-chart/zxporter \
--set zxporter.clusterToken=ci-test-token \
--set zxporter.kubeContextName=ci-test-cluster \
--set zxporter.k8sProvider=other \
> /dev/null
echo "zxporter chart rendered successfully"

validate-netmon:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 2 months ago

In general, to fix this class of problem you add a permissions block either at the root of the workflow (applies to all jobs unless overridden) or per job, and set only the minimal scopes needed (typically contents: read for simple CI jobs that just check out code).

For this specific workflow, both jobs only check out the code and run Helm commands; they don’t interact with issues, PRs, or perform any repository writes. The single best fix is therefore to add a root-level permissions section right under the name: (and before on:), setting contents: read. This will apply to both validate-zxporter and validate-netmon without altering existing behavior. No additional imports or methods are required, because this is a YAML configuration change only.

Concretely, in .github/workflows/helm-chart-validation.yml, insert:

permissions:
  contents: read

between line 1 (name: Helm Chart Validation) and line 3 (on:). No other changes are necessary.

Suggested changeset 1
.github/workflows/helm-chart-validation.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/helm-chart-validation.yml b/.github/workflows/helm-chart-validation.yml
--- a/.github/workflows/helm-chart-validation.yml
+++ b/.github/workflows/helm-chart-validation.yml
@@ -1,5 +1,8 @@
 name: Helm Chart Validation
 
+permissions:
+  contents: read
+
 on:
   pull_request:
     paths:
EOF
@@ -1,5 +1,8 @@
name: Helm Chart Validation

permissions:
contents: read

on:
pull_request:
paths:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +39 to +59
name: Lint & template zxporter-netmon chart
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: '3.12.3'

- name: Update chart dependencies
run: helm dependency update helm-chart/zxporter-netmon

- name: Lint chart
run: helm lint helm-chart/zxporter-netmon

- name: Template render check
run: |
helm template zxporter-netmon helm-chart/zxporter-netmon > /dev/null
echo "zxporter-netmon chart rendered successfully" No newline at end of file

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 2 months ago

In general, the fix is to explicitly set a restrictive permissions: block for the workflow or individual jobs so the GITHUB_TOKEN has only the minimal scopes required. For this Helm validation workflow, the jobs just need to read repository contents (to check out code and charts) and do not interact with issues, PRs, or perform any writes, so contents: read at the workflow root is sufficient.

The best fix without changing existing functionality is to add a single root-level permissions: block after the on: section. This will apply to both validate-zxporter and validate-netmon jobs since they do not define their own permissions:. No other logic, steps, or actions need to be modified. Concretely, in .github/workflows/helm-chart-validation.yml, add:

permissions:
  contents: read

between the on: block (ending at line 8) and the jobs: key (line 10). No additional imports or definitions are required because this is purely a YAML configuration change for GitHub Actions.

Suggested changeset 1
.github/workflows/helm-chart-validation.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/helm-chart-validation.yml b/.github/workflows/helm-chart-validation.yml
--- a/.github/workflows/helm-chart-validation.yml
+++ b/.github/workflows/helm-chart-validation.yml
@@ -7,6 +7,9 @@
       - 'helm-chart/zxporter-netmon/**'
   workflow_dispatch:
 
+permissions:
+  contents: read
+
 jobs:
   validate-zxporter:
     name: Lint & template zxporter chart
EOF
@@ -7,6 +7,9 @@
- 'helm-chart/zxporter-netmon/**'
workflow_dispatch:

permissions:
contents: read

jobs:
validate-zxporter:
name: Lint & template zxporter chart
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants