chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:22:34 +08:00
commit 4b22cfda96
9037 changed files with 2363717 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
const { getCloseReason } = require("./auto-close-pr.js");
module.exports = async ({ context, github }) => {
const closeReason = await getCloseReason({ github, context });
if (closeReason) {
console.log("PR will be auto-closed. Skipping labeling.");
return;
}
const { owner, repo } = context.repo;
const number = context.payload.pull_request.number;
const result = await github.graphql(
`query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
closingIssuesReferences(first: 10) {
nodes {
number
}
}
}
}
}`,
{ owner, repo, number }
);
const issues = result.repository.pullRequest.closingIssuesReferences.nodes;
for (const { number: issue_number } of issues) {
await github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels: ["has-closing-pr"],
});
}
};