CODEOWNER and chore assignee changes (#26379)

* CODEOWNER and chore assignee changes

* Codeowner action fixes

* Only call assignees API if array > 0

* Rebuild action assign-pr

---------

Co-authored-by: Pedro Sousa <680496+pedrosousa@users.noreply.github.com>
This commit is contained in:
Haley Campbell 2025-11-26 13:43:27 -06:00 committed by GitHub
parent a1655eccf9
commit 231bbf61ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 26 additions and 38 deletions

4
.github/CODEOWNERS vendored
View file

@ -200,8 +200,8 @@ src/content/docs/smart-shield/ @RebeccaTamachiro @cloudflare/pcx-technical-writi
# Reference architecture
/src/content/docs/reference-architecture/ @securitypedant @haleycode @cloudflare/pcx-technical-writing
/src/assets/images/reference-architecture/ @securitypedant @haleycode @cloudflare/pcx-technical-writing
/src/content/docs/reference-architecture/ @securitypedant @cloudflare/pcx-technical-writing
/src/assets/images/reference-architecture/ @securitypedant @cloudflare/pcx-technical-writing
# Security products

File diff suppressed because one or more lines are too long

View file

@ -78,24 +78,18 @@ async function list(
}
}
}
if (assignees.size === 0) {
// assign folks which will manually reassign
["haleycode", "pedrosousa", "dcpena", "patriciasantaana"].forEach(
(username) => assignees.add(username),
);
}
// don't self-assign
assignees.delete(author);
try {
await client.rest.issues.addAssignees({
repo: repository.name,
owner: repository.owner.login,
issue_number: prnumber,
assignees: [...assignees],
});
if (assignees.size > 0) {
await client.rest.issues.addAssignees({
repo: repository.name,
owner: repository.owner.login,
issue_number: prnumber,
assignees: [...assignees],
});
}
} catch (error) {
core.setFailed(error.message);
}

File diff suppressed because one or more lines are too long

View file

@ -65,22 +65,16 @@ import * as codeOwnersUtils from "codeowners-utils";
}
console.log("Assignees are:");
console.log(assignees);
if (assignees.size === 0) {
// assign folks which will manually reassign
["haleycode", "pedrosousa", "dcpena", "patriciasantaana"].forEach(
(username) => assignees.add(username),
);
}
const client = github.getOctokit(token);
await client.rest.issues.addAssignees({
owner: repository.owner.login,
issue_number: issue.number,
repo: repository.name,
assignees: [...assignees],
});
if (assignees.size > 0) {
await client.rest.issues.addAssignees({
owner: repository.owner.login,
issue_number: issue.number,
repo: repository.name,
assignees: [...assignees],
});
}
console.log("Assignees added (if present)");

View file

@ -57,4 +57,4 @@ jobs:
curl --silent -X POST -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/issues" \
-d "{\"title\": \"Broken Header Links Found\", \"body\": \"$(cat issue_body.txt)\", \"assignees\": [\"haleycode\"]}"
-d "{\"title\": \"Broken Header Links Found\", \"body\": \"$(cat issue_body.txt)\"}"

View file

@ -49,4 +49,4 @@ jobs:
curl --silent -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/cloudflare/cloudflare-docs/issues" \
-d "{\"title\": \"Unused Image Files Found\", \"body\": \"$(cat unused_files.txt)\", \"assignees\": [\"haleycode\"]}"
-d "{\"title\": \"Unused Image Files Found\", \"body\": \"$(cat unused_files.txt)\"}"