mirror of
https://github.com/PhilKes/NotallyX.git
synced 2025-06-28 12:19:55 +00:00
Set Github Token for generate-changelogs.sh
This commit is contained in:
parent
e48c7b5dec
commit
d42d9ebd69
2 changed files with 27 additions and 5 deletions
|
@ -134,14 +134,25 @@ tasks.preBuild.dependsOn(tasks.named("installLocalGitHooks"), tasks.exportTransl
|
|||
|
||||
tasks.register("generateChangelogs") {
|
||||
doLast {
|
||||
exec {
|
||||
commandLine("bash", rootProject.file("generate-changelogs.sh").absolutePath,
|
||||
val githubToken = providers.gradleProperty("CHANGELOG_GITHUB_TOKEN").orNull
|
||||
|
||||
val command = mutableListOf(
|
||||
"bash",
|
||||
rootProject.file("generate-changelogs.sh").absolutePath,
|
||||
"v${project.findProperty("app.lastVersionName").toString()}",
|
||||
rootProject.file("CHANGELOG.md").absolutePath)
|
||||
rootProject.file("CHANGELOG.md").absolutePath
|
||||
)
|
||||
if (!githubToken.isNullOrEmpty()) {
|
||||
command.add(githubToken)
|
||||
} else {
|
||||
println("CHANGELOG_GITHUB_TOKEN not found, which limits the allowed amount of Github API calls")
|
||||
}
|
||||
exec {
|
||||
commandLine(command)
|
||||
standardOutput = System.out
|
||||
errorOutput = System.err
|
||||
isIgnoreExitValue = true
|
||||
}
|
||||
|
||||
val config = PropertiesConfiguration()
|
||||
val fileHandler = FileHandler(config).apply {
|
||||
file = rootProject.file("gradle.properties")
|
||||
|
|
|
@ -2,5 +2,16 @@
|
|||
|
||||
VERSION_NAME=$1
|
||||
OUTPUT_FILE=$2
|
||||
GITHUB_TOKEN=${3:-$CHANGELOG_GITHUB_TOKEN}
|
||||
echo "Generating CHANGELOG.md entry since $VERSION_NAME to $OUTPUT_FILE"
|
||||
github_changelog_generator -u PhilKes -p NotallyX --since-tag $VERSION_NAME --no-pull-requests --include-tags-regex '^v\d+(\.\d+)*$' --include-labels enhancement,bug --exclude-labels duplicate,question,invalid,wontfix,'already done' --enhancement-label "### Added Features" --bugs-label "### Fixed Bugs" --base $OUTPUT_FILE --output $OUTPUT_FILE
|
||||
timeout 90s github_changelog_generator -u PhilKes -p NotallyX --since-tag "$VERSION_NAME" \
|
||||
--no-pull-requests --include-tags-regex '^v\d+(\.\d+)*$' \
|
||||
--include-labels enhancement,bug --exclude-labels duplicate,question,invalid,wontfix,'already done' \
|
||||
--enhancement-label "### Added Features" --bugs-label "### Fixed Bugs" \
|
||||
--base "$OUTPUT_FILE" --output "$OUTPUT_FILE" --token "$GITHUB_TOKEN"
|
||||
|
||||
# Check if timeout caused failure
|
||||
if [[ $? -eq 124 ]]; then
|
||||
echo "Error: github_changelog_generator timed out" >&2
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue