Skip to content

Commit b223ca2

Browse files
committed
chore(ci): ping releasers on blog post PR
1 parent bf98887 commit b223ca2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/create-release-post.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535

3636
- run: node --run scripts:release-post -- "$VERSION"
3737
working-directory: apps/site
38+
id: release-post
3839
env:
3940
VERSION: ${{ inputs.version }}
4041

@@ -54,4 +55,5 @@ jobs:
5455
commit-message: 'feat(blog): create post for ${{ inputs.version }}'
5556
labels: fast-track
5657
title: 'feat(blog): create post for ${{ inputs.version }}'
58+
assignees: ${{ steps.release-post.outputs.author }}
5759
draft: true

apps/site/scripts/release-post/index.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
'use strict';
2222

23-
import { existsSync, readFileSync } from 'node:fs';
23+
import { existsSync, readFileSync, appendFileSync } from 'node:fs';
2424
import { writeFile } from 'node:fs/promises';
2525
import { resolve } from 'node:path';
2626
import { parseArgs } from 'node:util';
@@ -125,7 +125,15 @@ const fetchAuthor = version => {
125125
return fetchChangelog(version)
126126
.then(section => findAuthorLogin(version, section))
127127
.then(author => request({ url: URLS.GITHUB_PROFILE(author), json: true }))
128-
.then(githubRes => githubRes.name);
128+
.then(({ name, login }) => {
129+
if (process.env.GITHUB_OUTPUT) {
130+
// If we are running in a GitHub runner, we need to store the username
131+
// so that the PR can be assigned to them
132+
appendFileSync(process.env.GITHUB_OUTPUT, `author=${login}\n`);
133+
}
134+
135+
return name;
136+
});
129137
};
130138

131139
const fetchChangelog = version => {

0 commit comments

Comments
 (0)