From 221211ec10e2b7adbbf1563121f33ad8f796eee1 Mon Sep 17 00:00:00 2001 From: "danil.radkovskyi" Date: Mon, 31 Aug 2026 16:31:48 +0200 Subject: [PATCH] update scripts for https://github.snooguts.net/reddit/reddit-devplatform-monorepo/pull/13726 --- ...it-docs-bump.sh => commit-docs-release.sh} | 0 scripts/commit-docs-version-bump.sh | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+) rename scripts/{commit-docs-bump.sh => commit-docs-release.sh} (100%) create mode 100755 scripts/commit-docs-version-bump.sh diff --git a/scripts/commit-docs-bump.sh b/scripts/commit-docs-release.sh similarity index 100% rename from scripts/commit-docs-bump.sh rename to scripts/commit-docs-release.sh diff --git a/scripts/commit-docs-version-bump.sh b/scripts/commit-docs-version-bump.sh new file mode 100755 index 00000000..41eaec0e --- /dev/null +++ b/scripts/commit-docs-version-bump.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -xeuo pipefail + +# Commits & pushes the regenerated "next" docs (produced by `yarn bump-version +# minor|major` in the monorepo) as their own PR branch, so /docs/next/ documents +# the new in-development version. +# +# Unlike commit-docs-release.sh, this does NOT cut a frozen versioned snapshot or +# change which version is @latest - it only updates the current "next" docs. +# +# The version is derived automatically from the monorepo's lerna.json, so no manual +# input is required. Pass an explicit "X.Y" as the first argument to override, or set +# DEVVIT_MONOREPO_DIR if your monorepo checkout is not the sibling "../devvit". + +MONOREPO_DIR="${DEVVIT_MONOREPO_DIR:-../devvit}" +VERSION="${1:-$(node -pe "require('${MONOREPO_DIR}/lerna.json').version.split('-')[0].split('.').slice(0, 2).join('.')")}" + +BRANCH="next-docs-${VERSION}" +git checkout -b "${BRANCH}" +yarn +git add . +git commit -m "Update next docs for v${VERSION}" +git push --set-upstream origin "${BRANCH}" +echo "Pushed ${BRANCH} to remote - go open a PR!"