[package]
versioned_files = ["package.json", "package-lock.json"]
changelog = "CHANGELOG.md"

[[workflows]]
name = "prepare-release"

[[workflows.steps]]
type = "Command"
command = "git switch -c release/$BASE_BRANCH"
shell = true

[[workflows.steps]]
type = "PrepareRelease"
ignore_conventional_commits = true

[[workflows.steps]]
type = "Command"
command = "npm run format && git add package.json package-lock.json"
shell = true

[[workflows.steps]]
type = "Command"
command = "git commit -m \"chore: prepare release $version\""

[[workflows.steps]]
type = "Command"
command = "git push --force --set-upstream origin release/$BASE_BRANCH"
shell = true

[[workflows.steps]]
type = "CreatePullRequest"
base = "main"

[workflows.steps.title]
template = "chore: prepare release $version"

[workflows.steps.body]
template = "This PR was created by Knope. Merging it will create a new release\n\n$changelog"

[[workflows]]
name = "release"

[[workflows.steps]]
type = "Release"

[[workflows]]
name = "document-change"

[[workflows.steps]]
type = "CreateChangeFile"

[[workflows]]
name = "get-version"
help_text = "Get the current version of the project"

[[workflows.steps]]
type = "Command"
command = 'echo "$version"'

[github]
owner = "apollographql"
repo = "apollo-client-ai-apps"
