@@ -101,19 +101,36 @@ jobs:
101
101
# Form the issue API URL dynamically
102
102
issue_api_url="https://api.github.com/repos/$repo/issues/$issue_num"
103
103
echo "API URL : $issue_api_url"
104
-
105
- # Check if the issue exists in the private repo
106
- response_code=$(curl -s -o /dev/null -w "%{http_code}" \
104
+
105
+ if [[ $repo == "devtron-labs/devtron" || $repo == "devtron-labs/devtron-services" || $repo == "devtron-labs/dashboard" ]]; then
106
+ echo "No extra arguments needed : public repository detected."
107
+ response_code=$(curl -s -o /dev/null -w "%{http_code}" \
108
+ " $issue_api_url" )
109
+
110
+ else
111
+ echo "Adding extra arguments for authentication : private repository detected."
112
+ response_code=$(curl -s -o /dev/null -w "%{http_code}" \
107
113
--header "authorization : Bearer ${{ secrets.GH_PR_VALIDATOR_TOKEN }}" \
108
114
" $issue_api_url" )
109
-
115
+ fi
116
+
117
+ echo "Response Code : $response_code"
110
118
if [[ "$response_code" -eq 200 ]]; then
111
119
echo "Issue # $issue_num is valid and exists in $repo."
112
120
113
121
# Fetch the current state of the issue (open/closed) from the private repository.
114
- issue_status=$(curl -s \
122
+ if [[ $repo == "devtron-labs/devtron" || $repo == "devtron-labs/devtron-services" || $repo == "devtron-labs/dashboard" ]]; then
123
+ echo "No extra arguments needed : public repository detected."
124
+ issue_status=$(curl -s \
125
+ " $issue_api_url" | jq '.state'|tr -d \")
126
+ else
127
+ echo "Adding extra arguments for authentication : private repository detected."
128
+ issue_status=$(curl -s \
115
129
--header "authorization : Bearer ${{ secrets.GH_PR_VALIDATOR_TOKEN }}" \
116
- " $issue_api_url" | jq '.state'|tr -d \")
130
+ " $issue_api_url" | jq '.state'|tr -d \")
131
+ fi
132
+ echo "Issue Status : $issue_status"
133
+
117
134
# Check if the issue is still open.
118
135
if [[ "$issue_status" == open ]]; then
119
136
echo "Issue # $issue_num is opened."
0 commit comments