Skip to content

Commit 22e57ce

Browse files
committed
fix(deployment): Fix naming and some conditions
1 parent 3db0513 commit 22e57ce

File tree

2 files changed

+9
-58
lines changed

2 files changed

+9
-58
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
helm-validate:
6060
runs-on: ubuntu-latest
6161
name: Validate Helm Chart
62-
if: github.event_name == 'push'
62+
if: github.event_name == 'pull_request'
6363

6464
steps:
6565
- uses: actions/checkout@v4
@@ -96,7 +96,7 @@ jobs:
9696
helm-unittest:
9797
runs-on: ubuntu-latest
9898
name: Run Helm Unit Tests
99-
if: github.event_name == 'push'
99+
if: github.event_name == 'pull_request'
100100

101101
steps:
102102
- uses: actions/checkout@v4
@@ -108,7 +108,7 @@ jobs:
108108

109109
- name: Install Helm Unittest Plugin
110110
run: |
111-
helm plugin install https://github.com/helm-unittest/helm-unittest.git
111+
helm plugin install https://github.com/helm-unittest/helm-unittest.git --verify=false
112112
113113
- name: Run Helm unit tests
114114
run: |
@@ -118,7 +118,6 @@ jobs:
118118
docker-build:
119119
runs-on: ubuntu-latest
120120
name: Build Docker Image
121-
if: github.event_name == 'pull_request'
122121

123122
steps:
124123
- name: Checkout repository

.github/workflows/release.yml

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,10 @@ on:
99
workflow_dispatch:
1010

1111
env:
12-
IMAGE_NAME: secops-mcp-server
12+
IMAGE_NAME: mcp-server
1313
REGISTRY: ghcr.io
1414

1515
jobs:
16-
detect-changes:
17-
runs-on: ubuntu-latest
18-
name: Detect Changes
19-
outputs:
20-
chart-changed: ${{ steps.detect.outputs.chart-changed }}
21-
version-bump: ${{ steps.detect.outputs.version-bump }}
22-
release-type: ${{ steps.detect.outputs.release-type }}
23-
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v4
26-
with:
27-
fetch-depth: 0
28-
29-
- name: Detect changes
30-
id: detect
31-
run: |
32-
# Check if chart files have changed
33-
if git diff HEAD~1 HEAD --name-only | grep -q "^helm/"; then
34-
echo "chart-changed=true" >> $GITHUB_OUTPUT
35-
else
36-
echo "chart-changed=false" >> $GITHUB_OUTPUT
37-
fi
38-
39-
# Determine release type based on commit message or tag
40-
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
41-
echo "release-type=tag" >> $GITHUB_OUTPUT
42-
TAG="${{ github.ref_name }}"
43-
if [[ $TAG =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
44-
echo "version-bump=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}" >> $GITHUB_OUTPUT
45-
fi
46-
else
47-
# Check commit message for semver directives
48-
COMMIT_MSG=$(git log -1 --pretty=%B)
49-
if echo "$COMMIT_MSG" | grep -qi "BREAKING\|major"; then
50-
echo "release-type=major" >> $GITHUB_OUTPUT
51-
elif echo "$COMMIT_MSG" | grep -qi "feat\|minor"; then
52-
echo "release-type=minor" >> $GITHUB_OUTPUT
53-
elif echo "$COMMIT_MSG" | grep -qi "fix\|patch"; then
54-
echo "release-type=patch" >> $GITHUB_OUTPUT
55-
else
56-
echo "release-type=patch" >> $GITHUB_OUTPUT
57-
fi
58-
fi
59-
6016
build-and-push-docker:
6117
runs-on: ubuntu-latest
6218
name: Build and Push Docker Image
@@ -108,11 +64,7 @@ jobs:
10864
publish-helm-chart:
10965
runs-on: ubuntu-latest
11066
name: Publish Helm Chart
111-
needs: [detect-changes, build-and-push-docker]
112-
if: |
113-
always() &&
114-
(github.event_name == 'push' && (github.ref_type == 'tag' || github.ref == 'refs/heads/main')) &&
115-
(needs.detect-changes.outputs.chart-changed == 'true' || github.ref_type == 'tag')
67+
needs: [ build-and-push-docker ]
11668
permissions:
11769
contents: read
11870
packages: write
@@ -168,14 +120,14 @@ jobs:
168120
CHART_VERSION=$(grep "^version:" ./helm/mcp-server/Chart.yaml | cut -d' ' -f2 | tr -d '"')
169121
echo "## ✅ Helm Chart Released" >> $GITHUB_STEP_SUMMARY
170122
echo "" >> $GITHUB_STEP_SUMMARY
171-
echo "Chart: gitguardian-secops-mcp-server" >> $GITHUB_STEP_SUMMARY
123+
echo "Chart: mcp-server" >> $GITHUB_STEP_SUMMARY
172124
echo "Version: ${CHART_VERSION}" >> $GITHUB_STEP_SUMMARY
173125
echo "" >> $GITHUB_STEP_SUMMARY
174126
echo "Published to: \`oci://${{ env.REGISTRY }}/${{ github.repository_owner }}/helm-charts\`" >> $GITHUB_STEP_SUMMARY
175127
echo "" >> $GITHUB_STEP_SUMMARY
176128
echo "Install with:" >> $GITHUB_STEP_SUMMARY
177129
echo '```bash' >> $GITHUB_STEP_SUMMARY
178-
echo "helm pull oci://${{ env.REGISTRY }}/${{ github.repository_owner }}/helm-charts/gitguardian-secops-mcp-server --version ${CHART_VERSION}" >> $GITHUB_STEP_SUMMARY
130+
echo "helm pull oci://${{ env.REGISTRY }}/${{ github.repository_owner }}/helm-charts/mcp-server --version ${CHART_VERSION}" >> $GITHUB_STEP_SUMMARY
179131
echo '```' >> $GITHUB_STEP_SUMMARY
180132
181133
publish-to-pypi:
@@ -235,7 +187,7 @@ jobs:
235187
publish-to-mcp-registry:
236188
runs-on: ubuntu-latest
237189
name: Publish to MCP Registry
238-
needs: [publish-to-pypi]
190+
needs: [ publish-to-pypi ]
239191
if: |
240192
false &&
241193
always() &&
@@ -302,7 +254,7 @@ jobs:
302254
create-github-release:
303255
runs-on: ubuntu-latest
304256
name: Create GitHub Release
305-
needs: [publish-helm-chart, publish-to-pypi]
257+
needs: [ publish-helm-chart, publish-to-pypi ]
306258
if: |
307259
always() &&
308260
github.event_name == 'push' &&

0 commit comments

Comments
 (0)