Skip to content

fix: Make ShadowRoot checks more robust#9988

Open
gonfunko wants to merge 1 commit into
mainfrom
shadowroot-check
Open

fix: Make ShadowRoot checks more robust#9988
gonfunko wants to merge 1 commit into
mainfrom
shadowroot-check

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Proposed Changes

This PR ensures that ShadowRoot is defined before performing an instanceof check against it. This shouldn't be a problem for browsers in practice, but it was tripping up JSDom, which does not define ShadowRoot.

@gonfunko gonfunko requested a review from a team as a code owner June 12, 2026 19:51
@gonfunko gonfunko requested a review from mikeharv June 12, 2026 19:51
@github-actions github-actions Bot added the PR: fix Fixes a bug label Jun 12, 2026
@sufu0614

Copy link
Copy Markdown

The basics

The details

Proposed Changes

This PR ensures that ShadowRoot is defined before performing an instanceof check against it. This shouldn't be a problem for browsers in practice, but it was tripping up JSDom, which does not define ShadowRoot.

1 similar comment
@sufu0614

Copy link
Copy Markdown

The basics

The details

Proposed Changes

This PR ensures that ShadowRoot is defined before performing an instanceof check against it. This shouldn't be a problem for browsers in practice, but it was tripping up JSDom, which does not define ShadowRoot.

@sufu0614 sufu0614 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026-06-12T19:51:34.8359906Z ##[group]Run actions/github-script@v8
2026-06-12T19:51:34.8361122Z with:
2026-06-12T19:51:34.8368325Z script: try {
if (context.payload.pull_request === undefined) {
throw new Error("Can't get pull_request payload. " +
'Check a request reviewer event was triggered.');
}
const reviewers = context.payload.pull_request.requested_reviewers;
// Assignees takes in a list of logins rather than the
// reviewer object.
const reviewerNames = reviewers.map(reviewer => reviewer.login);
const {number:issue_number} = context.payload.pull_request;
github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
assignees: reviewerNames
});
} catch (error) {
core.setFailed(error.message);
}

2026-06-12T19:51:34.8383520Z github-token: ***
2026-06-12T19:51:34.8384283Z debug: false
2026-06-12T19:51:34.8385033Z user-agent: actions/github-script
2026-06-12T19:51:34.8385947Z result-encoding: json
2026-06-12T19:51:34.8386847Z retries: 0
2026-06-12T19:51:34.8387646Z retry-exempt-status-codes: 400,401,403,404,422
2026-06-12T19:51:34.8388920Z ##[endgroup]
2026-06-12T19:51:35.5453017Z RequestError [HttpError]: Validation Failed: "Could not add assignees: Validation failed: Assignee has already been taken"
2026-06-12T19:51:35.5480067Z ##[error]Unhandled error: HttpError: Validation Failed: "Could not add assignees: Validation failed: Assignee has already been taken"
2026-06-12T19:51:35.5486202Z at /home/runner/work/_actions/actions/github-script/v8/dist/index.js:9537:21
2026-06-12T19:51:35.5487008Z at process.processTicksAndRejections (node:internal/process/task_queues:104:5) {
2026-06-12T19:51:35.5487552Z status: 422,
2026-06-12T19:51:35.5487899Z response: {
2026-06-12T19:51:35.5488295Z url: 'https://api.github.com/repos/RaspberryPiFoundation/blockly/issues/9988/assignees',
2026-06-12T19:51:35.5488709Z status: 422,
2026-06-12T19:51:35.5488925Z headers: {
2026-06-12T19:51:35.5489177Z 'access-control-allow-origin': '*',
2026-06-12T19:51:35.5490334Z 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset, Warning',
2026-06-12T19:51:35.5491874Z 'content-length': '229',
2026-06-12T19:51:35.5492210Z 'content-security-policy': "default-src 'none'",
2026-06-12T19:51:35.5492574Z 'content-type': 'application/json; charset=utf-8',
2026-06-12T19:51:35.5492898Z date: 'Fri, 12 Jun 2026 19:51:35 GMT',
2026-06-12T19:51:35.5493283Z 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
2026-06-12T19:51:35.5493663Z server: 'github.com',
2026-06-12T19:51:35.5494010Z 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
2026-06-12T19:51:35.5494422Z vary: 'Accept-Encoding, Accept, X-Requested-With',
2026-06-12T19:51:35.5494883Z 'x-accepted-github-permissions': 'issues=write; pull_requests=write',
2026-06-12T19:51:35.5495257Z 'x-content-type-options': 'nosniff',
2026-06-12T19:51:35.5495538Z 'x-frame-options': 'deny',
2026-06-12T19:51:35.5495842Z 'x-github-api-version-selected': '2022-11-28',
2026-06-12T19:51:35.5496165Z 'x-github-media-type': 'github.v3; format=json',
2026-06-12T19:51:35.5496518Z 'x-github-request-id': '5C40:2CB3E5:3E3FE15:E9537C1:6A2C6346',
2026-06-12T19:51:35.5496965Z 'x-ratelimit-limit': '5000',
2026-06-12T19:51:35.5497234Z 'x-ratelimit-remaining': '4992',
2026-06-12T19:51:35.5497500Z 'x-ratelimit-reset': '1781297494',
2026-06-12T19:51:35.5497769Z 'x-ratelimit-resource': 'core',
2026-06-12T19:51:35.5498030Z 'x-ratelimit-used': '8',
2026-06-12T19:51:35.5498283Z 'x-xss-protection': '0'
2026-06-12T19:51:35.5498571Z },
2026-06-12T19:51:35.5498768Z data: {
2026-06-12T19:51:35.5499161Z message: 'Validation Failed',
2026-06-12T19:51:35.5499411Z errors: [Array],
2026-06-12T19:51:35.5499800Z documentation_url: 'https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue',
2026-06-12T19:51:35.5500253Z status: '422'
2026-06-12T19:51:35.5500461Z }
2026-06-12T19:51:35.5500653Z },
2026-06-12T19:51:35.5500851Z request: {
2026-06-12T19:51:35.5501062Z method: 'POST',
2026-06-12T19:51:35.5501434Z url: 'https://api.github.com/repos/RaspberryPiFoundation/blockly/issues/9988/assignees',
2026-06-12T19:51:35.5501821Z headers: {
2026-06-12T19:51:35.5502062Z accept: 'application/vnd.github.v3+json',
2026-06-12T19:51:35.5502432Z 'user-agent': 'actions/github-script octokit-core.js/5.0.1 Node.js/24',
2026-06-12T19:51:35.5502787Z authorization: 'bearer [REDACTED]',
2026-06-12T19:51:35.5503090Z 'content-type': 'application/json; charset=utf-8'
2026-06-12T19:51:35.5503366Z },
2026-06-12T19:51:35.5503574Z body: '{"assignees":["mikeharv"]}',
2026-06-12T19:51:35.5503837Z request: {
2026-06-12T19:51:35.5504062Z agent: [Agent],
2026-06-12T19:51:35.5504302Z fetch: [Function: proxyFetch],
2026-06-12T19:51:35.5504582Z hook: [Function: bound bound register]
2026-06-12T19:51:35.5504839Z }
2026-06-12T19:51:35.5505024Z }
2026-06-12T19:51:35.5505209Z }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants