Skip to content

Commit 7eb9417

Browse files
committed
fix: missing username
1 parent cdeef1d commit 7eb9417

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

.github/workflows/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ jobs:
3232
github-token: ${{ secrets.GH_TOKEN_GH_NOTIFIER }}
3333
channels: C07L8EWB389
3434
slack-token: ${{ secrets.SLACK_TOKEN_GH_NOTIFIER }}
35+
with-test-data: true
3536
- name: Print Output
3637
run: echo "${{ steps.test-action.outputs.response }}"

dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37661,7 +37661,7 @@ var core = __nccwpck_require__(2186);
3766137661
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
3766237662
var github = __nccwpck_require__(5438);
3766337663
;// CONCATENATED MODULE: ./package.json
37664-
const package_namespaceObject = JSON.parse('{"u2":"@krauters/github-notifier","i8":"0.13.0","Xh":"https://github.com/krauters/github-notifier"}');
37664+
const package_namespaceObject = JSON.parse('{"u2":"@krauters/github-notifier","i8":"0.13.1","Xh":"https://github.com/krauters/github-notifier"}');
3766537665
;// CONCATENATED MODULE: ./src/defaults.ts
3766637666
const scmUrl = 'https://github.com';
3766737667
const prBaseUrl = `${scmUrl}/pulls?q=is%3Aopen+is%3Apr+archived%3Afalse+draft%3Afalse+user%3A`;
@@ -41955,7 +41955,8 @@ async function getPullBlocks(pull, slack, withUserMentions) {
4195541955
email,
4195641956
username,
4195741957
});
41958-
const displayName = slackUser?.profile?.display_name;
41958+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
41959+
const displayName = slackUser?.profile?.display_name || slackUser?.profile?.real_name_normalized || username;
4195941960
const imageUrl = slackUser?.profile?.image_72;
4196041961
contextBlocks.push({
4196141962
elements: [
@@ -41969,7 +41970,7 @@ async function getPullBlocks(pull, slack, withUserMentions) {
4196941970
type: 'image',
4197041971
},
4197141972
{
41972-
text: `*${displayName ?? username}* ${context} _${relativeHumanReadableAge}_.`,
41973+
text: `*${displayName}* ${context} _${relativeHumanReadableAge}_.`,
4197341974
type: 'mrkdwn',
4197441975
},
4197541976
],

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@krauters/github-notifier",
33
"description": "GitHub Notifier by Krauters – Post Open Pull Requests to Slack",
4-
"version": "0.13.0",
4+
"version": "0.13.1",
55
"author": "Colten Krauter <coltenkrauter>",
66
"type": "module",
77
"homepage": "https://github.com/krauters/github-notifier",

src/utils/slack/blocks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ export async function getPullBlocks(pull: Pull, slack: SlackClient, withUserMent
145145
username,
146146
})
147147

148-
const displayName = slackUser?.profile?.display_name
148+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
149+
const displayName = slackUser?.profile?.display_name || slackUser?.profile?.real_name_normalized || username
149150
const imageUrl = slackUser?.profile?.image_72
150151

151152
contextBlocks.push({
@@ -160,7 +161,7 @@ export async function getPullBlocks(pull: Pull, slack: SlackClient, withUserMent
160161
type: 'image',
161162
},
162163
{
163-
text: `*${displayName ?? username}* ${context} _${relativeHumanReadableAge}_.`,
164+
text: `*${displayName}* ${context} _${relativeHumanReadableAge}_.`,
164165
type: 'mrkdwn',
165166
},
166167
],

0 commit comments

Comments
 (0)