Skip to content

Commit 8fb2117

Browse files
committed
Merge branch 'main' into oss-ent-if-impl-1
2 parents 7820429 + 74ecc57 commit 8fb2117

File tree

280 files changed

+8023
-4973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+8023
-4973
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#ALL
2-
* @vikramdevtron @kripanshdevtron @nishant-d @prakarsh-dt
2+
* @vikramdevtron @nishant-d @prakarsh-dt @vivek-devtron
33

44
#Helm Charts
5-
charts/devtron/ @prakarsh-dt @pawan-mehta-dt @nishant-d
6-
scripts/devtron-reference-helm-charts @prakarsh-dt @pawan-mehta-dt @nishant-d
7-
CHANGELOG/ @prakarsh-dt @pawan-mehta-dt @nishant-d
5+
charts/devtron/ @prakarsh-dt @pawan-mehta-dt @nishant-d @vikramdevtron
6+
scripts/devtron-reference-helm-charts @prakarsh-dt @pawan-mehta-dt @nishant-d @vikramdevtron
7+
CHANGELOG/ @prakarsh-dt @pawan-mehta-dt @nishant-d @vikramdevtron
88

99
#Migration scripts
10-
scripts/sql @prakarsh-dt @vikramdevtron @kripanshdevtron @nishant-d
11-
scripts/utilities @prakarsh-dt @nishant-d @pawan-mehta-dt
10+
scripts/sql @prakarsh-dt @vikramdevtron @nishant-d @vivek-devtron
11+
scripts/utilities @prakarsh-dt @nishant-d @pawan-mehta-dt @vivek-devtron
1212

1313
#Github Specific
14-
.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt
14+
.github/ @prakarsh-dt @nishant-d @pawan-mehta-dt @vikramdevtron @tayalrishabh96

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Please include a summary of the change and which issue is fixed. Please also inc
2020
Fixes #
2121
<!--
2222
For example:
23-
Fixes https://github.com/devtron-labs/devtron/issues/00001
24-
Fixes devtron-labs/devtron#0001
23+
Fixes https://github.com/devtron-labs/<repo_name>/issues/<issue_number>
24+
Fixes devtron-labs/<repo_name>#<issue_number>
2525
2626
PS: Please ensure that you've attached a valid issue that is OPEN
2727
-->

.github/workflows/auto-label.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Devtron-auto-labeller
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
8+
jobs:
9+
manage-labels:
10+
if: ${{ !github.event.issue.pull_request }}
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v3
16+
17+
- name: Parse and manage labels
18+
env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: |
21+
set -e
22+
set -x # Enable debugging
23+
24+
# Extract comment on body and issue number
25+
COMMENT_BODY=$(jq -r '.comment.body' "$GITHUB_EVENT_PATH")
26+
ISSUE_NUMBER=$(jq -r '.issue.number // .pull_request.number' "$GITHUB_EVENT_PATH")
27+
28+
ORG_NAME="devtron-labs"
29+
30+
# checks if the person is authorized to add labels or not
31+
ORG_MEMBERSHIP_STATUS=$(gh api "orgs/$ORG_NAME/members/$COMMENT_AUTHOR" --silent --exit-status)
32+
33+
if [[ $? -ne 0 ]]; then
34+
gh issue comment "$ISSUE_NUMBER" --body "Hi @$COMMENT_AUTHOR, you must be a member of the organization '$ORG_NAME' to add or remove labels."
35+
36+
echo "User '$COMMENT_AUTHOR' is not a member of the organization '$ORG_NAME'. Exiting."
37+
exit 1
38+
fi
39+
40+
echo "User '$COMMENT_AUTHOR' is a verified member of the organization '$ORG_NAME'. Adding label"
41+
42+
43+
# Get the existing labels on the issue
44+
EXISTING_LABELS=$(gh issue view "$ISSUE_NUMBER" --json labels -q '.labels[].name')
45+
46+
# Add Label
47+
if [[ "$COMMENT_BODY" =~ ^/([^ ]+)$ ]]; then
48+
LABEL_NAME="${COMMENT_BODY:1}"
49+
50+
# check for already existing labels in reppo
51+
if gh label list --json name -q '.[].name' | grep -q "^$LABEL_NAME$"; then
52+
# Add the requested label, keeping existing ones intact
53+
gh issue edit "$ISSUE_NUMBER" --add-label "$LABEL_NAME"
54+
echo "Successfully added label '$LABEL_NAME' to issue #$ISSUE_NUMBER."
55+
else
56+
echo "The label '$LABEL_NAME' doesn't exist in the repository. You may need to create a label first."
57+
fi
58+
fi
59+
60+
# Remove Label Logic
61+
if [[ "$COMMENT_BODY" =~ ^/remove[[:space:]](.+)$ ]]; then
62+
LABEL_NAME_TO_REMOVE=$(echo "$COMMENT_BODY" | sed -n 's|/remove ||p')
63+
64+
# Remove the specified label
65+
if echo "$EXISTING_LABELS" | grep -q "^$LABEL_NAME_TO_REMOVE$"; then
66+
gh issue edit "$ISSUE_NUMBER" --remove-label "$LABEL_NAME_TO_REMOVE"
67+
echo "Successfully removed label '$LABEL_NAME_TO_REMOVE' from issue #$ISSUE_NUMBER."
68+
else
69+
echo "The label '$LABEL_NAME_TO_REMOVE' is not attached to issue #$ISSUE_NUMBER."
70+
fi
71+
fi

0 commit comments

Comments
 (0)