forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request RocketChat#31329 from RocketChat/release-6.5.2
Release 6.5.2
- Loading branch information
Showing
10 changed files
with
155 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/meteor': patch | ||
--- | ||
|
||
Bump @rocket.chat/meteor version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
--- | ||
|
||
Fixed conversations in queue being limited to 50 items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/meteor': patch | ||
--- | ||
|
||
Fix wrong value used for Workspace Registration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Release PR Description' | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
update-pr: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.head_ref, 'release-') | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.CI_PAT }} | ||
|
||
- name: Setup NodeJS | ||
uses: ./.github/actions/setup-node | ||
with: | ||
node-version: 14.21.3 | ||
cache-modules: true | ||
install: true | ||
|
||
- uses: dtinth/setup-github-actions-caching-for-turbo@v1 | ||
|
||
- name: Build packages | ||
run: yarn build | ||
|
||
- name: Update PR description | ||
uses: ./packages/release-action | ||
with: | ||
action: update-pr-description | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CI_PAT }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
import * as core from '@actions/core'; | ||
import { exec } from '@actions/exec'; | ||
import * as github from '@actions/github'; | ||
|
||
import { setupOctokit } from './setupOctokit'; | ||
import { getChangelogEntry, getEngineVersionsMd, readPackageJson } from './utils'; | ||
|
||
export async function updatePRDescription({ | ||
githubToken, | ||
mainPackagePath, | ||
cwd = process.cwd(), | ||
}: { | ||
githubToken: string; | ||
mainPackagePath: string; | ||
cwd?: string; | ||
}) { | ||
const octokit = setupOctokit(githubToken); | ||
|
||
// generate change logs from changesets | ||
await exec('yarn', ['changeset', 'version']); | ||
|
||
// get version from main package | ||
const { version: newVersion } = await readPackageJson(mainPackagePath); | ||
|
||
const mainPackageChangelog = path.join(mainPackagePath, 'CHANGELOG.md'); | ||
|
||
const changelogContents = fs.readFileSync(mainPackageChangelog, 'utf8'); | ||
const changelogEntry = getChangelogEntry(changelogContents, newVersion); | ||
if (!changelogEntry) { | ||
// we can find a changelog but not the entry for this version | ||
// if this is true, something has probably gone wrong | ||
throw new Error('Could not find changelog entry for version newVersion'); | ||
} | ||
|
||
const releaseBody = (await getEngineVersionsMd(cwd)) + changelogEntry.content; | ||
|
||
core.info('get PR description'); | ||
const result = await octokit.rest.pulls.get({ | ||
pull_number: github.context.issue.number, | ||
body: releaseBody, | ||
...github.context.repo, | ||
}); | ||
|
||
const { body: originalBody = '' } = result.data; | ||
|
||
const cleanBody = originalBody?.replace(/<!-- release-notes-start -->.*<!-- release-notes-end -->/s, '').trim() || ''; | ||
|
||
const bodyUpdated = `${cleanBody} | ||
<!-- release-notes-start --> | ||
<!-- This content is automatically generated. Changing this will not reflect on the final release log --> | ||
_You can see below a preview of the release change log:_ | ||
# ${newVersion} | ||
${releaseBody} | ||
<!-- release-notes-end -->`; | ||
|
||
if (bodyUpdated === originalBody) { | ||
core.info('no changes to PR description'); | ||
return; | ||
} | ||
|
||
core.info('update PR description'); | ||
await octokit.rest.pulls.update({ | ||
owner: github.context.repo.owner, | ||
repo: github.context.repo.repo, | ||
pull_number: github.context.issue.number, | ||
body: bodyUpdated, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters