Skip to content

Commit 71b8b16

Browse files
committed
🔨 Add Fetch Issues Script
1 parent da6f264 commit 71b8b16

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

‎fetch-issues.sh‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/zsh
2+
set -eux
3+
4+
usage() {
5+
echo "Usage: $0 <rule>"
6+
echo "Fetches issues for the specified rule from SonarCloud."
7+
echo "Example:"
8+
echo "$0 java:S106"
9+
}
10+
11+
# Check if "rule" parameter is provided
12+
if [ -z "$1" ]; then
13+
echo "Error: No rule parameter provided."
14+
usage
15+
exit 1
16+
fi
17+
18+
rule=$1
19+
host=${SONAR_HOST:-https://sonarcloud.io}
20+
curl \
21+
--header "Authorization: Bearer ${SONAR_TOKEN}" \
22+
"${host}/api/issues/search?organization=pixee&componentKeys=pixee_bad-java-code&rules=${rule}"

0 commit comments

Comments
 (0)