Skip to content

Commit

Permalink
Merge pull request #2165 from digitalfabrik/bugfix/release-notes-number
Browse files Browse the repository at this point in the history
Fix release notes number of #2137
  • Loading branch information
timobrembeck committed Mar 28, 2023
2 parents 10cb9e8 + b9de63d commit c0feeaf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
16 changes: 16 additions & 0 deletions tools/_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@ function require_installed {
fi
}

# This function checks if the github cli is installed
function require_gh_cli_installed {
if [[ ! -x "$(command -v gh)" ]]; then
echo "The GitHub cli is not installed. Please install github-cli manually and run this script again." | print_error
exit 1
fi
}

# This function checks if jq is installed
function require_jq_installed {
if [[ ! -x "$(command -v jq)" ]]; then
echo "The json parser jq is not installed. Please install jq manually and run this script again." | print_error
exit 1
fi
}

# This function executes the given command with the user who invoked sudo
function deescalate_privileges {
# Check if command is running as root
Expand Down
6 changes: 1 addition & 5 deletions tools/have_i_reviewed_enough.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
# shellcheck source=./tools/_functions.sh
source "$(dirname "${BASH_SOURCE[0]}")/_functions.sh"

# Check if requirements are satisfied
if [[ ! -x "$(command -v gh)" ]]; then
echo "The GitHub cli is not installed. Please install github-cli manually and run this script again." | print_error
exit 1
fi
require_gh_cli_installed

# Parse command line arguments
while [ "$#" -gt 0 ]; do
Expand Down
7 changes: 6 additions & 1 deletion tools/new_release_note.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
source "$(dirname "${BASH_SOURCE[0]}")/_functions.sh"

require_installed
require_gh_cli_installed
require_jq_installed

ISSUE=$1
LANGUAGE=$2
Expand Down Expand Up @@ -39,7 +41,10 @@ RELEASE_NOTES_DIR="integreat_cms/release_notes"
UNRELEASED_DIR="${RELEASE_NOTES_DIR}/current/unreleased"
OUTPUT="${UNRELEASED_DIR}/${ISSUE}.yml"

echo "Creating new release note..." | print_info
TITLE=$(gh issue view "${ISSUE}" --json title --jq ".title")

echo -e "Creating new release note for issue #${ISSUE} with title:\n" | print_info
echo -e "\t${TITLE}\n" | print_bold

DEEPL_AUTH_KEY=$(integreat-cms-cli shell -c 'from django.conf import settings; print(settings.DEEPL_AUTH_KEY or "")')

Expand Down

0 comments on commit c0feeaf

Please sign in to comment.