-
Notifications
You must be signed in to change notification settings - Fork 2.9k
newchange #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
newchange #178
Changes from 29 commits
0a25770
d0f2f56
d482145
a11c828
de0807f
1e1f15b
5a2abac
edd0851
168e1b6
ab873d8
9567630
a7d0154
23be654
fa20786
c4b7822
19cef0a
c5c7296
623d513
0353d52
bef69d5
c70e1c8
8d94899
8411602
ff39902
76a75a4
8ef10c7
3e7b1e0
bedf4e2
c312916
4d00a28
351e579
dda7c3d
842c73b
ccddb9a
0e6085c
fa9985b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,108 +1,228 @@ | ||||||||||||||||||||||||||||
| # CI for Product Catalog Service | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| name: product-catalog-ci | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||
| name: Product Catalog CI-CD | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| DOCKER_IMAGE: leninfitfreak/product-catalog | ||||||||||||||||||||||||||||
| PRODUCT_CATALOG_PORT: 8088 | ||||||||||||||||||||||||||||
| SERVICE_PATH: src/product-catalog | ||||||||||||||||||||||||||||
| K8S_DEPLOY_FILE: kubernetes/productcatalog/deploy.yaml | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: checkout code | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Setup Go 1.22 | ||||||||||||||||||||||||||||
| uses: actions/setup-go@v2 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| go-version: 1.22 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Build | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| cd src/product-catalog | ||||||||||||||||||||||||||||
| go mod download | ||||||||||||||||||||||||||||
| go build -o product-catalog-service main.go | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: unit tests | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| cd src/product-catalog | ||||||||||||||||||||||||||||
| go test ./... | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| code-quality: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: checkout code | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Setup Go 1.22 | ||||||||||||||||||||||||||||
| uses: actions/setup-go@v2 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| go-version: 1.22 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Run golangci-lint | ||||||||||||||||||||||||||||
| uses: golangci/golangci-lint-action@v6 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| version: v1.55.2 | ||||||||||||||||||||||||||||
| run: golangci-lint run | ||||||||||||||||||||||||||||
| working-directory: src/product-catalog | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| docker: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| needs: build | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: checkout code | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Install Docker | ||||||||||||||||||||||||||||
| uses: docker/setup-buildx-action@v1 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Login to Docker | ||||||||||||||||||||||||||||
| uses: docker/login-action@v3 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| username: ${{ secrets.DOCKER_USERNAME }} | ||||||||||||||||||||||||||||
| password: ${{ secrets.DOCKER_TOKEN }} | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Docker Push | ||||||||||||||||||||||||||||
| uses: docker/build-push-action@v6 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| context: src/product-catalog | ||||||||||||||||||||||||||||
| file: src/product-catalog/Dockerfile | ||||||||||||||||||||||||||||
| push: true | ||||||||||||||||||||||||||||
| tags: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}} | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| updatek8s: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| needs: docker | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: checkout code | ||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Update tag in kubernetes deployment manifest | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}}|" kubernetes/productcatalog/deploy.yaml | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Commit and push changes | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| git config --global user.email "[email protected]" | ||||||||||||||||||||||||||||
| git config --global user.name "Abhishek Veeramalla" | ||||||||||||||||||||||||||||
| git add kubernetes/productcatalog/deploy.yaml | ||||||||||||||||||||||||||||
| git commit -m "[CI]: Update product catalog image tag" | ||||||||||||||||||||||||||||
| git push origin HEAD:main -f | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| # 1. Unit Tests | ||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| unit-tests: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| go-version: "1.24.x" | ||||||||||||||||||||||||||||
| check-latest: true | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Check Go Version | ||||||||||||||||||||||||||||
| run: go version | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Ensure go.sum | ||||||||||||||||||||||||||||
| working-directory: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
| run: go mod tidy | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Cache Go Modules | ||||||||||||||||||||||||||||
| uses: actions/cache@v3 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| path: ~/go/pkg/mod | ||||||||||||||||||||||||||||
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||
| ${{ runner.os }}-go- | ||||||||||||||||||||||||||||
|
Comment on lines
+44
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update - - name: Cache Go Modules
- uses: actions/cache@v3
+ - name: Cache Go Modules
+ uses: actions/cache@v4📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.7)44-44: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Install Dependencies | ||||||||||||||||||||||||||||
| working-directory: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
| run: go get -u -t ./... | ||||||||||||||||||||||||||||
|
Comment on lines
+51
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Don’t use - run: go get -u -t ./...
+ run: go test -run=^$ -v ./... # forces module download without upgrades📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Run Unit Tests | ||||||||||||||||||||||||||||
| working-directory: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
| run: go test ./... -v | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| # 2. Code Quality | ||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| code-quality: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| needs: [unit-tests] | ||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
|
Comment on lines
+66
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Let code-quality failures fail the pipeline Static-analysis findings are only useful when they block merges. Remove - continue-on-error: true
+# continue-on-error: true # delete or comment-out
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| go-version: "1.24.x" | ||||||||||||||||||||||||||||
| check-latest: true | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Check Go Version | ||||||||||||||||||||||||||||
| run: go version | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Install Staticcheck | ||||||||||||||||||||||||||||
| run: go install honnef.co/go/tools/cmd/staticcheck@latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Run Staticcheck | ||||||||||||||||||||||||||||
| working-directory: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
| run: staticcheck ./... | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| # 3. Vulnerability Scan | ||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| vulnerability-scan: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| needs: [code-quality] | ||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
|
Comment on lines
+92
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Same for the vulnerability scan – do not ignore GoSec results Security scans that never fail defeat their purpose. Drop the flag here as well. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| go-version: "1.24.x" | ||||||||||||||||||||||||||||
| check-latest: true | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Check Go Version | ||||||||||||||||||||||||||||
| run: go version | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Install GoSec | ||||||||||||||||||||||||||||
| run: go install github.com/securego/gosec/v2/cmd/gosec@latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Run GoSec Security Scan | ||||||||||||||||||||||||||||
| working-directory: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
| run: gosec ./... | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| # 4. Build Binary | ||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| build-binary: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| needs: [vulnerability-scan] | ||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| go-version: "1.24.x" | ||||||||||||||||||||||||||||
| check-latest: true | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Check Go Version | ||||||||||||||||||||||||||||
| run: go version | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Build Binary | ||||||||||||||||||||||||||||
| working-directory: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| export PRODUCT_CATALOG_PORT=${{ env.PRODUCT_CATALOG_PORT }} | ||||||||||||||||||||||||||||
| go build -o product-catalog . | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| name: product-catalog-binary | ||||||||||||||||||||||||||||
| path: ${{ env.SERVICE_PATH }}/product-catalog | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| # 5. Docker Build & Push | ||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| docker-build-push: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| needs: [build-binary] | ||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| name: product-catalog-binary | ||||||||||||||||||||||||||||
| path: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Get Build Version | ||||||||||||||||||||||||||||
| id: vars | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| VERSION=build-${GITHUB_RUN_NUMBER} | ||||||||||||||||||||||||||||
| RUN_ID_TAG=run-${GITHUB_RUN_ID} | ||||||||||||||||||||||||||||
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||||||||||||||||||||||||||||
| echo "RUN_ID_TAG=$RUN_ID_TAG" >> $GITHUB_ENV | ||||||||||||||||||||||||||||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
| echo "runid=$RUN_ID_TAG" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Docker Login | ||||||||||||||||||||||||||||
| uses: docker/login-action@v2 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| username: ${{ secrets.DOCKER_USERNAME }} | ||||||||||||||||||||||||||||
| password: ${{ secrets.DOCKER_TOKEN }} | ||||||||||||||||||||||||||||
|
Comment on lines
+163
to
+166
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update outdated Docker login action. The - - name: Docker Login
- uses: docker/login-action@v2
+ - name: Docker Login
+ uses: docker/login-action@v3
🧰 Tools🪛 actionlint (1.7.7)100-100: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Build and Tag Docker Image | ||||||||||||||||||||||||||||
| working-directory: ${{ env.SERVICE_PATH }} | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| docker build -t ${{ env.DOCKER_IMAGE }}:${{ steps.vars.outputs.version }} . | ||||||||||||||||||||||||||||
| docker tag ${{ env.DOCKER_IMAGE }}:${{ steps.vars.outputs.version }} ${{ env.DOCKER_IMAGE }}:${{ steps.vars.outputs.runid }} | ||||||||||||||||||||||||||||
| docker tag ${{ env.DOCKER_IMAGE }}:${{ steps.vars.outputs.version }} ${{ env.DOCKER_IMAGE }}:latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Push Docker Image | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| docker push ${{ env.DOCKER_IMAGE }}:${{ steps.vars.outputs.version }} | ||||||||||||||||||||||||||||
| docker push ${{ env.DOCKER_IMAGE }}:${{ steps.vars.outputs.runid }} | ||||||||||||||||||||||||||||
| docker push ${{ env.DOCKER_IMAGE }}:latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Save Build Version | ||||||||||||||||||||||||||||
| run: echo "${{ steps.vars.outputs.version }}" > build-version.txt | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| name: build-version | ||||||||||||||||||||||||||||
| path: build-version.txt | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| # 6. Update Kubernetes Manifest | ||||||||||||||||||||||||||||
| # --------------------- | ||||||||||||||||||||||||||||
| update-k8s: | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| needs: [docker-build-push] | ||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| name: build-version | ||||||||||||||||||||||||||||
| path: . | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Load Build Version | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| VERSION=$(cat build-version.txt) | ||||||||||||||||||||||||||||
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||||||||||||||||||||||||||||
| echo "Using VERSION=$VERSION" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Update Kubernetes Manifest | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| sed -i "s|image: .*|image: ${{ env.DOCKER_IMAGE }}:${VERSION}|" ${{ env.K8S_DEPLOY_FILE }} | ||||||||||||||||||||||||||||
| echo "Updated image in ${{ env.K8S_DEPLOY_FILE }} to ${{ env.DOCKER_IMAGE }}:${VERSION}" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Commit and Push Updated Manifest | ||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| git config user.name "lenin" | ||||||||||||||||||||||||||||
| git config user.email "[email protected]" | ||||||||||||||||||||||||||||
|
Comment on lines
+214
to
+215
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove hardcoded user credentials from git config. The workflow uses hardcoded personal user details which should not be committed to the repository. Use generic bot credentials or GitHub Actions bot instead. - git config user.name "lenin"
- git config user.email "[email protected]"
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| git add ${{ env.K8S_DEPLOY_FILE }} | ||||||||||||||||||||||||||||
| git commit -m "Update image tag to ${VERSION} [CI SKIP]" || echo "No changes to commit" | ||||||||||||||||||||||||||||
| git push origin main | ||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,3 +26,5 @@ ENV AD_PORT 9099 | |
|
|
||
| ENTRYPOINT ["./build/install/opentelemetry-demo-ad/bin/Ad"] | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||
| lenin | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Stray placeholder file – remove unless required The file contains only the word “lenin” and is not referenced anywhere. -lenin📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||
| <<<<<<< HEAD | ||||
| jdsiGJERWIO'GJRW | ||||
| ======= | ||||
| dsvdfbgsnjet | ||||
|
|
||||
| efger;gjiewluh wEI NU9 | ||||
| vgergr | ||||
| >>>>>>> ab873d8ecb3cfc535669eee68c1db2abd43f995c | ||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Unit tests must fail the pipeline, not be ignored
continue-on-error: truedisables the safety net that unit-tests provide—builds will look green even when tests are red. Remove this line unless there is a very strong justification.📝 Committable suggestion
🤖 Prompt for AI Agents