diff --git a/.bettercodehub.yml b/.bettercodehub.yml new file mode 100644 index 0000000..46be470 --- /dev/null +++ b/.bettercodehub.yml @@ -0,0 +1,5 @@ +component_depth: 6 +default_excludes: true +languages: + - java + - kotlin diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..f2b9af9 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,8 @@ +version = 1 + +[[analyzers]] +name = "java" +enabled = true + + [analyzers.meta] + runtime_version = "11" diff --git a/.github/dco.yml b/.github/dco.yml new file mode 100644 index 0000000..5fef0a5 --- /dev/null +++ b/.github/dco.yml @@ -0,0 +1,3 @@ +# Disable sign-off chcecking for members of the Gradle GitHub organization +require: + members: false diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1ef0730 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "gradle" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..8d79e81 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,21 @@ +name-template: $NEXT_MINOR_VERSION +tag-template: v$NEXT_MINOR_VERSION + +categories: + - title: 🚀 New features and improvements + labels: + - enhancement + - title: 🐛 Bug Fixes + labels: + - bug + - title: 🚦 Internal changes + labels: + - internal + +exclude-labels: + - no-changelog + - duplicate + - invalid + +template: | + $CHANGES diff --git a/.github/scripts/build-release-note.sh b/.github/scripts/build-release-note.sh new file mode 100644 index 0000000..f3d1ea2 --- /dev/null +++ b/.github/scripts/build-release-note.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +echo "Changelog:" +TAG=$(echo "refs/tags/$1" | sed "s/.*tags\///g") +START="### v$TAG" +END="###" +sed -n "/^$START$/,/$END/p" CHANGELOG.md | sed '1d' | sed '$d' | sed '$d' diff --git a/.github/scripts/close-pending.sh b/.github/scripts/close-pending.sh new file mode 100644 index 0000000..b7ed417 --- /dev/null +++ b/.github/scripts/close-pending.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +MESSAGE=$(cat $SCRIPT_DIR/closing-message.txt) + +while IFS= read -r number && + IFS= read -r title; do + echo "Closing PR ($number): $title" + curl -s -o /dev/null \ + -X POST \ + --data "$(jq --arg body "$MESSAGE" -n '{body: $body}')" \ + --header "authorization: Bearer $GITHUB_TOKEN" \ + --header 'content-type: application/json' \ + "https://api.github.com/repos/AlexRogalskiy/object-mappers-playground/issues/$number/comments" + + curl -s -o /dev/null \ + -X PATCH \ + --data '{"state": "close"}' \ + --header "authorization: Bearer $GITHUB_TOKEN" \ + --header 'content-type: application/json' \ + "https://api.github.com/repos/AlexRogalskiy/object-mappers-playground/pulls/$number" +done < <(curl -H "Content-Type: application/json" \ + --header "authorization: Bearer $GITHUB_TOKEN" \ + "https://api.github.com/search/issues?q=repo:AlexRogalskiy/object-mappers-playground+type:pr+updated:<$(date -d "-21 days" +%Y-%m-%d)+label:pending+is:open" | + jq -r '.items[] | (.number,.title)') diff --git a/.github/scripts/comment-commands/close.sh b/.github/scripts/comment-commands/close.sh new file mode 100644 index 0000000..6c04626 --- /dev/null +++ b/.github/scripts/comment-commands/close.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +#doc: Close pending pull request temporary +# shellcheck disable=SC2124 +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +MESSAGE=$(cat $SCRIPT_DIR/../closing-message.txt) + +set +x #GITHUB_TOKEN +curl -s -o /dev/null \ + -X POST \ + --data "$(jq --arg body "$MESSAGE" -n '{body: $body}')" \ + --header "authorization: Bearer $GITHUB_TOKEN" \ + --header 'content-type: application/json' \ + "$(jq -r '.issue.comments_url' "$GITHUB_EVENT_PATH")" + +curl -s -o /dev/null \ + -X PATCH \ + --data '{"state": "close"}' \ + --header "authorization: Bearer $GITHUB_TOKEN" \ + --header 'content-type: application/json' \ + "$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")" diff --git a/.github/scripts/comment-commands/debug.sh b/.github/scripts/comment-commands/debug.sh new file mode 100644 index 0000000..fbc68ce --- /dev/null +++ b/.github/scripts/comment-commands/debug.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +#doc: Show current event json to debug problems + +echo "\`\`\`" +cat "$GITHUB_EVENT_PATH" +echo "\`\`\`" diff --git a/.github/scripts/comment-commands/help.sh b/.github/scripts/comment-commands/help.sh new file mode 100644 index 0000000..babec9b --- /dev/null +++ b/.github/scripts/comment-commands/help.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +#doc: Show all the available comment commands +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +echo "Available commands:" +DOCTAG="#" +DOCTAG="${DOCTAG}doc" +for command in "$DIR"/*.sh; do + COMMAND_NAME="$(basename "$command" | sed 's/\.sh$//')" + if [ "$COMMAND_NAME" != "debug" ]; then + printf " * /**%s** %s\n" "$COMMAND_NAME" "$(grep $DOCTAG "$command" | sed "s/$DOCTAG//g")" + fi +done diff --git a/.github/scripts/comment-commands/label.sh b/.github/scripts/comment-commands/label.sh new file mode 100644 index 0000000..d7612b4 --- /dev/null +++ b/.github/scripts/comment-commands/label.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +#doc: add new label to the issue: `/label