diff --git a/.github/workflows/create-release-post.yml b/.github/workflows/create-release-post.yml index ececb58af6005..098e9905612a8 100644 --- a/.github/workflows/create-release-post.yml +++ b/.github/workflows/create-release-post.yml @@ -35,6 +35,7 @@ jobs: - run: node --run scripts:release-post -- "$VERSION" working-directory: apps/site + id: release-post env: VERSION: ${{ inputs.version }} @@ -54,4 +55,5 @@ jobs: commit-message: 'feat(blog): create post for ${{ inputs.version }}' labels: fast-track title: 'feat(blog): create post for ${{ inputs.version }}' + assignees: ${{ steps.release-post.outputs.author }} draft: true diff --git a/apps/site/scripts/release-post/index.mjs b/apps/site/scripts/release-post/index.mjs index 895a284188670..e634a138565a5 100644 --- a/apps/site/scripts/release-post/index.mjs +++ b/apps/site/scripts/release-post/index.mjs @@ -20,7 +20,7 @@ 'use strict'; -import { existsSync, readFileSync } from 'node:fs'; +import { existsSync, readFileSync, appendFileSync } from 'node:fs'; import { writeFile } from 'node:fs/promises'; import { resolve } from 'node:path'; import { parseArgs } from 'node:util'; @@ -125,7 +125,15 @@ const fetchAuthor = version => { return fetchChangelog(version) .then(section => findAuthorLogin(version, section)) .then(author => request({ url: URLS.GITHUB_PROFILE(author), json: true })) - .then(githubRes => githubRes.name); + .then(({ name, login }) => { + if (process.env.GITHUB_OUTPUT) { + // If we are running in a GitHub runner, we need to store the username + // so that the PR can be assigned to them + appendFileSync(process.env.GITHUB_OUTPUT, `author=${login}\n`); + } + + return name; + }); }; const fetchChangelog = version => {