Skip to content
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

chore: Main sync develop #82

Merged
10 commits merged into from
Sep 24, 2024
53 changes: 53 additions & 0 deletions .github/workflows/tag-patch-incre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Increment tag for patch or minor

on:
pull_request:
branches:
- main
types:
- closed # Trigger only when a PR is closed (merged or not)

jobs:
tag:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create new tag
env:
TOKEN: ${{ secrets.TAG_CREATION_TOKEN_PUBLIC }}
run: |
echo $TOKEN | gh auth login --with-token
latest_tag=$(git tag --sort=refname | tail -n 1)
echo "Latest tag: $latest_tag"

# Extract major and minor versions
version=$(echo $latest_tag | cut -d. -f1-2)
# Extract patch version
patch=$(echo $latest_tag | cut -d. -f3)
# Extract minor version
minor=$(echo $latest_tag | cut -d. -f2)
major=$(echo $latest_tag | cut -d. -f1)

# Check if the incoming branch starts with 'release-candidate-'
incoming_branch="${{ github.head_ref }}"
if [[ "$incoming_branch" == release-candidate-* ]]; then
# Increment minor version and reset patch
new_minor=$((minor+1))
new_tag="$major.$new_minor.0"
echo "New tag will be (minor increment): $new_tag"
else
# Increment patch version
new_tag="$version.$((patch+1))"
echo "New tag will be (patch increment): $new_tag"
fi

git config --global user.email "devops@devtron.ai"
git config --global user.name "systemsdt"
git tag $new_tag
git push origin $new_tag

3 changes: 2 additions & 1 deletion src/common/mustacheHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ export class MustacheHelper {
mapSeverityCount(imageScanExecutionInfo:any):severityCount | {} {
if (imageScanExecutionInfo && imageScanExecutionInfo.severityCount){
return {
critical: imageScanExecutionInfo.severityCount.critical,
high: imageScanExecutionInfo.severityCount.high,
moderate: imageScanExecutionInfo.severityCount.moderate,
medium: imageScanExecutionInfo.severityCount.medium,
low: imageScanExecutionInfo.severityCount.low,
}
} else{
Expand Down
5 changes: 3 additions & 2 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ export interface vulnerability {
permission: string;
}
export interface severityCount {
critical: number;
high: number;
moderate: number;
medium: number;
low: number;
}
}
export interface WebhookParsedEvent {
eventType?: string;
devtronAppId?: number;
Expand Down