Skip to content

chore(workflow): fix release action#6

Merged
hhk7734 merged 1 commit intomainfrom
cd
Dec 30, 2025
Merged

chore(workflow): fix release action#6
hhk7734 merged 1 commit intomainfrom
cd

Conversation

@hhk7734
Copy link
Copy Markdown
Member

@hhk7734 hhk7734 commented Dec 30, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 30, 2025 02:03
@hhk7734 hhk7734 merged commit 3d2122c into main Dec 30, 2025
7 checks passed
@hhk7734 hhk7734 deleted the cd branch December 30, 2025 02:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the release workflow by moving the Helm chart release action from an external repository reference to a local composite action within the repository. The change improves maintainability by consolidating workflow logic and updates the authentication token used for GitOps operations.

  • Introduces a new local composite action for releasing Helm charts
  • Updates the production CD workflow to use the local action instead of external reference
  • Changes the authentication token from INTERNAL_ACCESS_TOKEN to GITOPS_TOKEN

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/release-chart/action.yaml New composite action that packages and publishes Helm charts to the moreh-dev/helm-charts repository
.github/workflows/cd-prod.yaml Updates the release step to use the local action and updates the GitHub token secret name

Comment on lines +34 to +37
sed -i "s/^version:.*/version: \"${{ inputs.chart_version }}\"/g" ${{ inputs.chart_path }}/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"${{ inputs.chart_version }}\"/g" ${{ inputs.chart_path }}/Chart.yaml

helm package ${{ inputs.chart_path }}
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sed commands use in-place editing with the -i flag, which modifies the Chart.yaml file in the checked-out source repository. However, this modification happens before packaging, and the changes are not committed to the source repository - only the packaged chart is pushed to helm-charts. This could lead to inconsistency where the Chart.yaml in the source repository doesn't match the packaged chart version. Consider whether the Chart.yaml should be updated in the source repository as well, or if the version should already be set correctly before this action runs.

Suggested change
sed -i "s/^version:.*/version: \"${{ inputs.chart_version }}\"/g" ${{ inputs.chart_path }}/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"${{ inputs.chart_version }}\"/g" ${{ inputs.chart_path }}/Chart.yaml
helm package ${{ inputs.chart_path }}
helm package \
--version "${{ inputs.chart_version }}" \
--app-version "${{ inputs.chart_version }}" \
${{ inputs.chart_path }}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,62 @@
name: "Release Helm Chart"
description: "Release Helm Chart "
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a trailing space after "Release Helm Chart" in the description. This should be removed for consistency.

Suggested change
description: "Release Helm Chart "
description: "Release Helm Chart"

Copilot uses AI. Check for mistakes.
description: "The version of application. It should be a semantic version"
github_token:
required: true
description: "Github repo access internal token"
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub branding should use "GitHub" with capital "H" instead of "Github". This is the correct capitalization for the brand name.

Suggested change
description: "Github repo access internal token"
description: "GitHub repo access internal token"

Copilot uses AI. Check for mistakes.
git add .
git config --global user.name "${{ github.event.head_commit.author.name }}"
git config --global user.email "${{ github.event.head_commit.author.email }}"
git commit -m "feat: add ${{ inputs.chart_name }} ${{ inputs.chart_version }}"
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git commit step does not handle the case where there are no changes to commit. If the chart version already exists or no files were modified, the git commit command will fail and cause the workflow to fail. Consider adding a check to verify if there are changes before committing, or use a flag like --allow-empty or check git status first.

Suggested change
git commit -m "feat: add ${{ inputs.chart_name }} ${{ inputs.chart_version }}"
if ! git diff --cached --quiet; then
git commit -m "feat: add ${{ inputs.chart_name }} ${{ inputs.chart_version }}"
else
echo "No changes to commit"
fi

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +52
git config --global user.name "${{ github.event.head_commit.author.name }}"
git config --global user.email "${{ github.event.head_commit.author.email }}"
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using github.event.head_commit.author.name and github.event.head_commit.author.email may not be available in all GitHub event contexts (e.g., workflow_dispatch, pull_request events). This could cause the git config commands to set empty values, leading to commit failures. Consider using a fallback value or a more reliable context variable like github.actor.

Suggested change
git config --global user.name "${{ github.event.head_commit.author.name }}"
git config --global user.email "${{ github.event.head_commit.author.email }}"
git config --global user.name "${{ github.event.head_commit.author.name || github.actor }}"
git config --global user.email "${{ github.event.head_commit.author.email || format('{0}@users.noreply.github.com', github.actor) }}"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants