Skip to content

Commit

Permalink
Issue #12456: Remove new curl parameter from all GitHub actions for r…
Browse files Browse the repository at this point in the history
…elease
  • Loading branch information
stoyanK7 authored and romani committed Nov 26, 2022
1 parent 7855254 commit cd3daa9
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .ci/close-create-milestone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ source ./.ci/util.sh
checkForVariable "GITHUB_TOKEN"

echo "Close previous milestone at github"
MILESTONE_ID=$(curl --fail-with-body -s \
MILESTONE_ID=$(curl -s \
-X GET https://api.github.com/repos/checkstyle/checkstyle/milestones?state=open \
| jq ".[0] | .number")
curl --fail-with-body -i -H "Authorization: token $GITHUB_TOKEN" \
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-d "{ \"state\": \"closed\" }" \
-X PATCH https://api.github.com/repos/checkstyle/checkstyle/milestones/"$MILESTONE_ID"

Expand All @@ -26,7 +26,7 @@ LAST_SUNDAY_DAY=$(cal -d "$(date -d "next month" +"%Y-%m")" \
LAST_SUNDAY_DATETIME=$(date -d "next month" +"%Y-%m")"-$LAST_SUNDAY_DAY""T08:00:00Z"
echo "$LAST_SUNDAY_DATETIME"

curl --fail-with-body -i -H "Authorization: token $GITHUB_TOKEN" \
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-d "{ \"title\": \"$CURRENT_VERSION\", \
\"state\": \"open\", \
\"description\": \"\", \
Expand Down
4 changes: 2 additions & 2 deletions .ci/creation-of-issue-in-other-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ TARGET_VERSION=$1
echo TARGET_VERSION="$TARGET_VERSION"

echo "Creation of issue in eclipse-cs repo ..."
curl --fail-with-body -i -H "Authorization: token $GITHUB_TOKEN" \
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-d "{ \"title\": \"upgrade to checkstyle $TARGET_VERSION\", \
\"body\": \"https://checkstyle.org/releasenotes.html#Release_$TARGET_VERSION\" \
}" \
-X POST https://api.github.com/repos/checkstyle/eclipse-cs/issues

echo "Creation of issue in sonar-checkstyle repo ..."
curl --fail-with-body -i -H "Authorization: token $GITHUB_TOKEN" \
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-d "{ \"title\": \"upgrade to checkstyle $TARGET_VERSION\", \
\"body\": \"https://checkstyle.org/releasenotes.html#Release_$TARGET_VERSION\" \
}" \
Expand Down
2 changes: 1 addition & 1 deletion .ci/releasenotes-gen-xdoc-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CS_RELEASE_VERSION="$(getCheckstylePomVersion)"
echo CS_RELEASE_VERSION="$CS_RELEASE_VERSION"

cd .ci-temp/checkstyle
LATEST_RELEASE_TAG=$(curl --fail-with-body -s \
LATEST_RELEASE_TAG=$(curl -s \
https://api.github.com/repos/checkstyle/checkstyle/releases/latest \
| jq ".tag_name")
echo LATEST_RELEASE_TAG="$LATEST_RELEASE_TAG"
Expand Down
3 changes: 1 addition & 2 deletions .ci/tweet-releasenotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ fi

cd .ci-temp/checkstyle

curl --fail-with-body \
https://api.github.com/repos/checkstyle/checkstyle/releases \
curl https://api.github.com/repos/checkstyle/checkstyle/releases \
-H "Authorization: token $GITHUB_READ_ONLY_TOKEN" \
-o /var/tmp/cs-releases.json

Expand Down
4 changes: 2 additions & 2 deletions .ci/update-github-milestone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ TARGET_VERSION=$1
echo TARGET_VERSION="$TARGET_VERSION"

echo "Updating milestone at github"
MILESTONE_ID=$(curl --fail-with-body -s \
MILESTONE_ID=$(curl -s \
-X GET https://api.github.com/repos/checkstyle/checkstyle/milestones?state=open \
| jq ".[0] | .number")

echo TARGET_VERSION="$TARGET_VERSION"
echo MILESTONE_ID="$MILESTONE_ID"

curl --fail-with-body \
curl \
-X PATCH https://api.github.com/repos/checkstyle/checkstyle/milestones/"$MILESTONE_ID" \
-H "Authorization: token $GITHUB_TOKEN" \
-d "{ \"title\": \"$TARGET_VERSION\" }"
5 changes: 2 additions & 3 deletions .ci/update-github-page.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ fi

cd .ci-temp/checkstyle

curl --fail-with-body \
https://api.github.com/repos/checkstyle/checkstyle/releases \
curl https://api.github.com/repos/checkstyle/checkstyle/releases \
-H "Authorization: token $GITHUB_TOKEN" \
-o /var/tmp/cs-releases.json

Expand Down Expand Up @@ -88,7 +87,7 @@ echo "JSON Body"
cat body.json

echo "Updating Github tag page"
curl --fail-with-body \
curl \
-X PATCH https://api.github.com/repos/checkstyle/checkstyle/releases/"$RELEASE_ID" \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
Expand Down
4 changes: 2 additions & 2 deletions .ci/upload-all-jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ mvn -e --no-transfer-progress -Passembly package

echo "Publishing 'all' jar to Github"
UPLOAD_LINK=https://uploads.github.com/repos/checkstyle/checkstyle/releases
RELEASE_ID=$(curl --fail-with-body -s -X GET \
RELEASE_ID=$(curl -s -X GET \
https://api.github.com/repos/checkstyle/checkstyle/releases/tags/checkstyle-"$TARGET_VERSION" \
| jq ".id")


curl --fail-with-body -i -H "Authorization: token $GITHUB_TOKEN" \
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/zip" \
--data-binary @"target/checkout/target/checkstyle-$TARGET_VERSION-all.jar" \
-X POST "$UPLOAD_LINK"/"$RELEASE_ID"/assets?name=checkstyle-"$TARGET_VERSION"-all.jar
Expand Down
2 changes: 1 addition & 1 deletion .ci/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ verify-no-exception-configs)
if [[ $PULL_REQUEST =~ ^([0-9]+)$ ]]; then
LINK_PR=https://api.github.com/repos/checkstyle/checkstyle/pulls/$PULL_REQUEST
REGEXP="https://github.com/checkstyle/contribution/pull/"
PR_DESC=$(curl --fail-with-body -s -H "Authorization: token $READ_ONLY_TOKEN" "$LINK_PR" \
PR_DESC=$(curl -s -H "Authorization: token $READ_ONLY_TOKEN" "$LINK_PR" \
| jq '.body' | grep $REGEXP | cat )
echo 'PR Description grepped:'"${PR_DESC:0:180}"
if [[ -z $PR_DESC ]]; then
Expand Down
7 changes: 7 additions & 0 deletions config/checkstyle_non_main_files_suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,12 @@
<suppress id="properCurlCommand" files=".ci[\\/]sonar_break_build\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]no_old_refs\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]pr-description\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]close-create-milestone\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]tweet-releasenotes\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]upload-all-jar\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]update-github-page\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]update-github-milestone\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]releasenotes-gen-xdoc-push\.sh"/>
<suppress id="properCurlCommand" files=".ci[\\/]creation-of-issue-in-other-repos\.sh"/>

</suppressions>

0 comments on commit cd3daa9

Please sign in to comment.