Skip to content

Commit fdef784

Browse files
committed
[sc-30416] fixup
Signed-off-by: Jake Schurch <[email protected]>
1 parent 431b635 commit fdef784

File tree

4 files changed

+44
-9
lines changed

4 files changed

+44
-9
lines changed

dist/notify/index.js

Lines changed: 34 additions & 4 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@jest/globals": "^30.0.5",
5353
"@octokit/types": "^14.1.0",
5454
"@octokit/webhooks-types": "^7.6.1",
55+
"@types/js-yaml": "^4.0.9",
5556
"@types/node": "^20.12.11",
5657
"@typescript-eslint/parser": "^7.9.0",
5758
"@vercel/ncc": "^0.38.3",

pnpm-lock.yaml

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

src/getMessageAuthorFactory.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {endGroup, info, isDebug, startGroup, warning} from '@actions/core'
2-
import {readFileSync} from 'fs'
32
import {context} from '@actions/github'
43
import type {Commit} from '@octokit/webhooks-types'
54
import {OctokitClient} from './github/types'
65
import {GitHubSender, isPushEvent, senderFromPayload} from './github/webhook'
76
import {SlackClient} from './slack/SlackClient'
87
import {MemberWithProfile, MessageAuthor} from './slack/types'
8+
import * as yaml from 'js-yaml'
99

1010
export const GH_MERGE_QUEUE_BOT_USERNAME = 'github-merge-queue[bot]'
1111

@@ -49,11 +49,7 @@ function getMessageAuthorFromRawMapping(
4949
if (rawMapping.trim().startsWith('{')) {
5050
mapping = JSON.parse(rawMapping) as Record<string, MessageAuthor>
5151
} else {
52-
// Try YAML if not JSON
53-
// Only attempt if yaml is available
5452
try {
55-
// @ts-ignore
56-
const yaml = require('js-yaml')
5753
mapping = yaml.load(rawMapping) as Record<string, MessageAuthor>
5854
} catch (yamlErr) {
5955
warning('Failed to parse mapping as YAML.')

0 commit comments

Comments
 (0)