From 1eb6b4c39e0edef8a8db18149efd2384b16a4453 Mon Sep 17 00:00:00 2001 From: Acy Watson Date: Fri, 17 Nov 2023 12:13:30 -0700 Subject: [PATCH] It's a journey (#5242) --- .github/workflows/version.yml | 8 +++++++- scripts/npm/update-changelog.js | 6 +----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 4fda185f03c..77680228110 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -28,7 +28,13 @@ jobs: git config user.name "Lexical GitHub Actions Bot" git config user.email "<>" - run: npm install - - run: npm run increment-version -- --i $INCREMENT + - id: latest-release + uses: pozetroninc/github-action-get-latest-release@master + with: + owner: facebook + repo: lexical + excludes: draft + - run: LATEST_RELEASE=${{ latest-release.outputs.release }} npm run increment-version -- --i $INCREMENT env: INCREMENT: ${{ inputs.increment }} - run: git push -u git@github.com:facebook/lexical.git --follow-tags diff --git a/scripts/npm/update-changelog.js b/scripts/npm/update-changelog.js index 9b5a098ecc0..f5607e127df 100644 --- a/scripts/npm/update-changelog.js +++ b/scripts/npm/update-changelog.js @@ -17,12 +17,9 @@ const isPrerelease = process.env.npm_package_version.indexOf('-') !== -1; async function updateChangelog() { const date = (await exec(`git show --format=%as | head -1`)).stdout.trim(); const header = `## v${process.env.npm_package_version} (${date})`; - const previousReleaseHash = ( - await exec(`git log -n 1 origin/latest --pretty=format:"%H"`) - ).stdout.trim(); const changelogContent = ( await exec( - `git --no-pager log --oneline ${previousReleaseHash}...HEAD~1 --pretty=format:\"- %s %an\"`, + `git --no-pager log --oneline ${process.env.LATEST_RELEASE}...HEAD~1 --pretty=format:\"- %s %an\"`, ) ).stdout .replace(/[^a-zA-Z0-9()\n \-,\.#]/g, '') @@ -33,7 +30,6 @@ async function updateChangelog() { await exec( `cat ./CHANGELOG.md >> ${tmpFilePath} && mv ${tmpFilePath} ./CHANGELOG.md`, ); - await exec(`git commit --amend --no-edit`); } if (!isPrerelease) {