Skip to content

Commit d18ad5b

Browse files
committed
changes
1 parent d26f862 commit d18ad5b

File tree

8 files changed

+88
-73
lines changed

8 files changed

+88
-73
lines changed

actions/copy-demos/dist/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ function read_demos_from_json(json_path) {
20492049
async function run() {
20502050
const gradio_version = coreExports.getInput("gradio_version");
20512051
const gradio_client_version = coreExports.getInput("gradio_client_version");
2052-
const config_path = coreExports.getInput("config_path") || path.join(root, ".config", "demos.json");
2052+
const config_path = coreExports.getInput("config_path") || path.join(__dirname, ".config", "demos.json");
20532053
if (!gradio_version || !gradio_client_version) {
20542054
console.error(
20552055
"Usage: node script.js <gradio_version> <gradio_client_version> [config_path]"
@@ -2072,7 +2072,6 @@ ${gradio_client_version}
20722072
${gradio_version}
20732073
pypistats==1.1.0
20742074
plotly
2075-
matplotlib
20762075
altair
20772076
vega_datasets
20782077
`.trim();

actions/filter-paths/dist/index.js

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86782,7 +86782,6 @@ function match_filter(patterns, files) {
8678286782
}
8678386783
async function run() {
8678486784
var _a;
86785-
console.log(JSON.stringify(context, null, 2));
8678686785
const filter_name = coreExports.getInput("filter");
8678786786
const path = coreExports.getInput("path") || ".github/filters.json";
8678886787
const token = coreExports.getInput("token");
@@ -86795,27 +86794,16 @@ async function run() {
8679586794
}
8679686795
const filter = filters[filter_name];
8679786796
let files = [];
86798-
if (context.eventName === "pull_request") {
86799-
for await (const response of octokit.paginate.iterator(
86800-
octokit.rest.pulls.listFiles,
86801-
{
86802-
owner: context.repo.owner,
86803-
repo: context.repo.repo,
86804-
pull_number: (_a = context.payload.pull_request) == null ? void 0 : _a.number,
86805-
per_page: 100
86806-
}
86807-
)) {
86808-
files = [...files, ...parse_data(response.data)];
86809-
}
86810-
} else if (context.eventName === "push" || context.eventName === "workflow_dispatch") {
86811-
const response = await octokit.rest.repos.getCommit({
86797+
for await (const response of octokit.paginate.iterator(
86798+
octokit.rest.pulls.listFiles,
86799+
{
8681286800
owner: context.repo.owner,
8681386801
repo: context.repo.repo,
86814-
ref: context.ref
86815-
});
86816-
files = [...files, ...parse_data(response.data.files)];
86817-
} else {
86818-
throw new Error("Unsupported event");
86802+
pull_number: (_a = context.payload.pull_request) == null ? void 0 : _a.number,
86803+
per_page: 100
86804+
}
86805+
)) {
86806+
files = [...files, ...parse_data(response.data)];
8681986807
}
8682086808
files = files.map((f) => f.filename);
8682186809
const result = match_filter(filter, files);

actions/find-pr/dist/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85283,7 +85283,7 @@ function getOctokit(token, options, ...additionalPlugins) {
8528385283
}
8528485284
getOctokit_1 = github.getOctokit = getOctokit;
8528585285
async function run() {
85286-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
85286+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
8528785287
const octokit = getOctokit_1(coreExports.getInput("github_token"));
8528885288
const { repo, owner } = context.repo;
8528985289
const outputs = {
@@ -85294,8 +85294,7 @@ async function run() {
8529485294
mergeable: false,
8529585295
merge_sha: false,
8529685296
found_pr: false,
85297-
labels: [],
85298-
actor: false
85297+
labels: []
8529985298
};
8530085299
const open_pull_requests = await get_prs(octokit, repo, owner);
8530185300
if (context.eventName === "push") {
@@ -85396,7 +85395,6 @@ async function run() {
8539685395
merge_sha,
8539785396
labels
8539885397
} = get_pr_details_from_title(open_pull_requests, title);
85399-
console.log(JSON.stringify(context, null, 2));
8540085398
outputs.source_repo = source_repo || false;
8540185399
outputs.source_branch = source_branch || false;
8540285400
outputs.pr_number = pr_number ?? false;
@@ -85405,8 +85403,7 @@ async function run() {
8540585403
outputs.mergeable = mergeable === "MERGEABLE" ? true : false;
8540685404
outputs.merge_sha = merge_sha || sha || false;
8540785405
outputs.labels = labels;
85408-
outputs.actor = ((_t = (_s = context.payload.workflow_run) == null ? void 0 : _s.actor) == null ? void 0 : _t.login) || false;
85409-
} else if ((_v = (_u = context.payload) == null ? void 0 : _u.workflow_run) == null ? void 0 : _v.event) {
85406+
} else if ((_t = (_s = context.payload) == null ? void 0 : _s.workflow_run) == null ? void 0 : _t.event) {
8541085407
coreExports.setFailed(
8541185408
"This action can only be run on pull_request, push, or issue_comment events or workflow_run events triggered from those events."
8541285409
);

actions/generate-changeset/dist/index.js

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119510,9 +119510,14 @@ ${approved ? "- [x] Maintainers can unapprove the changeset by selecting this ch
119510119510

119511119511
</details>
119512119512
`.trim();
119513+
const normalize2 = (text2) => text2.replace(/\(https:\/\/github.com[^]*\.md\)/g, "").trim();
119514+
const changes = !previous_comment || normalize2(previous_comment) !== normalize2(new_comment);
119515+
if (!changes && previous_comment) {
119516+
console.log(`[create_changeset_comment] No changes detected, skipping comment update`);
119517+
}
119513119518
return {
119514119519
pr_comment_content: new_comment,
119515-
changes: changeset_content.replace(/\(https:\/\/github.com[^]*\.md\)/, "") !== new_comment.replace(/\(https:\/\/github.com[^]*\.md\)/, "")
119520+
changes
119516119521
};
119517119522
}
119518119523
const md_parser = unified().use(remarkParse).use(remarkFrontmatter).use(remarkGfm);
@@ -119576,8 +119581,13 @@ function check_for_manual_selection_and_approval(md_src, wasEdited, editor) {
119576119581
}
119577119582
let was_checkbox_edit = false;
119578119583
if (wasEdited && editor) {
119579-
was_checkbox_edit = true;
119580-
console.log(`[check_for_manual_selection_and_approval] Detected checkbox edit by ${editor}`);
119584+
if (editor !== "gradio-pr-bot") {
119585+
was_checkbox_edit = true;
119586+
console.log(`[check_for_manual_selection_and_approval] Detected checkbox edit by human: ${editor}`);
119587+
} else {
119588+
was_checkbox_edit = false;
119589+
console.log(`[check_for_manual_selection_and_approval] Bot edit detected (not a checkbox edit): ${editor}`);
119590+
}
119581119591
} else if (wasEdited) {
119582119592
console.log(`[check_for_manual_selection_and_approval] Edit detected but no editor field`);
119583119593
} else {
@@ -119847,15 +119857,17 @@ async function run() {
119847119857
if (approved2 && selection.was_checkbox_edit) {
119848119858
const actor = coreExports.getInput("actor");
119849119859
approved_by2 = actor && actor.length && actor !== "false" ? actor : comment.editor || selection.approved_by;
119850-
coreExports.info(`[Manual Mode] Checkbox edit approved - using approver: ${approved_by2}`);
119860+
coreExports.info(`[Manual Mode] Human checkbox edit approved - using approver: ${approved_by2}`);
119851119861
} else if (approved2) {
119852119862
approved_by2 = selection.approved_by;
119853119863
coreExports.info(`[Manual Mode] Already approved - keeping approver: ${approved_by2}`);
119864+
} else {
119865+
coreExports.info(`[Manual Mode] Not approved (checkbox unchecked or never checked)`);
119854119866
}
119855119867
} else {
119856119868
approved2 = selection.approved;
119857119869
approved_by2 = selection.approved_by;
119858-
coreExports.info(`[Manual Mode] Non-checkbox edit detected - preserving state:`);
119870+
coreExports.info(`[Manual Mode] Bot/non-checkbox edit detected - preserving existing state:`);
119859119871
coreExports.info(` - Approved: ${approved2}`);
119860119872
coreExports.info(` - Approved by: ${approved_by2 || "none"}`);
119861119873
}
@@ -119887,19 +119899,19 @@ async function run() {
119887119899
changelog_entry_type
119888119900
});
119889119901
if (changes2) {
119890-
coreExports.info("Changeset comment updated.");
119902+
coreExports.info("[Manual Mode] Changeset comment has changes, updating...");
119891119903
const url = await client.upsert_comment({
119892119904
pr_id,
119893119905
body: pr_comment_content2,
119894119906
comment_id: comment == null ? void 0 : comment.id
119895119907
});
119896119908
coreExports.setOutput("comment_url", url);
119909+
coreExports.info("[Manual Mode] Changeset comment updated successfully.");
119897119910
} else {
119898119911
coreExports.setOutput("comment_url", comment == null ? void 0 : comment.url);
119899-
coreExports.info("Changeset comment unchanged.");
119912+
coreExports.info("[Manual Mode] Changeset comment unchanged, skipping update.");
119900119913
}
119901119914
coreExports.setOutput("skipped", "false");
119902-
coreExports.info("Changeset comment updated.");
119903119915
return;
119904119916
}
119905119917
const { packages: pkgs } = manypkgGetPackages_cjsExports.getPackagesSync(process.cwd());
@@ -119934,15 +119946,17 @@ async function run() {
119934119946
if (approved && selection.was_checkbox_edit) {
119935119947
const actor = coreExports.getInput("actor");
119936119948
approved_by = actor && actor.length && actor !== "false" ? actor : comment.editor || selection.approved_by;
119937-
coreExports.info(`[Normal Mode] Checkbox edit approved - using approver: ${approved_by}`);
119949+
coreExports.info(`[Normal Mode] Human checkbox edit approved - using approver: ${approved_by}`);
119938119950
} else if (approved) {
119939119951
approved_by = selection.approved_by;
119940119952
coreExports.info(`[Normal Mode] Already approved - keeping approver: ${approved_by}`);
119953+
} else {
119954+
coreExports.info(`[Normal Mode] Not approved (checkbox unchecked or never checked)`);
119941119955
}
119942119956
} else {
119943119957
approved = selection.approved;
119944119958
approved_by = selection.approved_by;
119945-
coreExports.info(`[Normal Mode] Non-checkbox edit detected - preserving state:`);
119959+
coreExports.info(`[Normal Mode] Bot/non-checkbox edit detected - preserving existing state:`);
119946119960
coreExports.info(` - Approved: ${approved}`);
119947119961
coreExports.info(` - Approved by: ${approved_by || "none"}`);
119948119962
}
@@ -120004,20 +120018,22 @@ async function run() {
120004120018
manual_package_selection,
120005120019
changeset_content,
120006120020
changeset_url: `https://github.com/${source_repo_name}/edit/${source_branch_name}/${changeset_path}`,
120021+
previous_comment: comment == null ? void 0 : comment.body,
120007120022
approved,
120008120023
approved_by,
120009120024
changelog_entry_type: type2 || "unknown"
120010120025
});
120011120026
if (changes) {
120012-
coreExports.info("Changeset comment updated.");
120027+
coreExports.info("[Normal Mode] Changeset comment has changes, updating...");
120013120028
const url = await client.upsert_comment({
120014120029
pr_id,
120015120030
body: pr_comment_content,
120016120031
comment_id: comment == null ? void 0 : comment.id
120017120032
});
120018120033
coreExports.setOutput("comment_url", url);
120034+
coreExports.info("[Normal Mode] Changeset comment updated successfully.");
120019120035
} else {
120020-
coreExports.info("Changeset comment unchanged.");
120036+
coreExports.info("[Normal Mode] Changeset comment unchanged, skipping update.");
120021120037
coreExports.setOutput("comment_url", comment == null ? void 0 : comment.url);
120022120038
}
120023120039
coreExports.setOutput("skipped", "false");

actions/publish-pypi/dist/index.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34623,7 +34623,7 @@ const runtime_prerequisites_txt = [
3462334623
`pip-with-requires-python==1.0.1
3462434624

3462534625
# The following packages are considered to be unsafe in a requirements file:
34626-
pip>=23.3.1`
34626+
pip==22.3.1`
3462734627
];
3462834628
const runtime_in = [
3462934629
"runtime.in",
@@ -34672,7 +34672,7 @@ keyring==23.11.0
3467234672
# via twine
3467334673
more-itertools==9.0.0
3467434674
# via jaraco-classes
34675-
pkginfo==1.12.0
34675+
pkginfo==1.10.0
3467634676
# via
3467734677
# -r runtime.in
3467834678
# twine
@@ -34767,17 +34767,7 @@ async function run() {
3476734767
"pip",
3476834768
[
3476934769
"install",
34770-
"--user",
34771-
"--upgrade",
34772-
"--no-cache-dir",
34773-
"pip>=23.3.1"
34774-
]
34775-
);
34776-
await exec_2(
34777-
"pip",
34778-
[
34779-
"install",
34780-
"twine==6",
34770+
"twine==4",
3478134771
"--user",
3478234772
"--upgrade",
3478334773
"--no-cache-dir",

actions/set-commit-status/dist/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85295,7 +85295,7 @@ async function run() {
8529585295
run_id: parseInt(run_id)
8529685296
});
8529785297
const message = "Skipped — No changes detected";
85298-
const res = await octokit.rest.repos.createCommitStatus({
85298+
octokit.rest.repos.createCommitStatus({
8529985299
owner: context.repo.owner,
8530085300
repo: context.repo.repo,
8530185301
sha,
@@ -85304,8 +85304,5 @@ async function run() {
8530485304
context: name,
8530585305
target_url: url || workflow_run.data.html_url
8530685306
});
85307-
console.log({ sha, name, url });
85308-
console.log(JSON.stringify(workflow_run, null, 2));
85309-
console.log(JSON.stringify(res, null, 2));
8531085307
}
8531185308
run();

packages/generate-changeset/index.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,18 @@ async function run() {
124124
actor && actor.length && actor !== "false"
125125
? actor
126126
: comment.editor || selection.approved_by;
127-
info(`[Manual Mode] Checkbox edit approved - using approver: ${approved_by}`);
127+
info(`[Manual Mode] Human checkbox edit approved - using approver: ${approved_by}`);
128128
} else if (approved) {
129129
approved_by = selection.approved_by;
130130
info(`[Manual Mode] Already approved - keeping approver: ${approved_by}`);
131+
} else {
132+
info(`[Manual Mode] Not approved (checkbox unchecked or never checked)`);
131133
}
132134
} else {
135+
// Bot edit or other non-checkbox edit - preserve existing state
133136
approved = selection.approved;
134137
approved_by = selection.approved_by;
135-
info(`[Manual Mode] Non-checkbox edit detected - preserving state:`);
138+
info(`[Manual Mode] Bot/non-checkbox edit detected - preserving existing state:`);
136139
info(` - Approved: ${approved}`);
137140
info(` - Approved by: ${approved_by || 'none'}`);
138141
}
@@ -176,22 +179,21 @@ async function run() {
176179
});
177180

178181
if (changes) {
179-
info("Changeset comment updated.");
182+
info("[Manual Mode] Changeset comment has changes, updating...");
180183
const url = await client.upsert_comment({
181184
pr_id,
182185
body: pr_comment_content,
183186
comment_id: comment?.id,
184187
});
185188
setOutput("comment_url", url);
189+
info("[Manual Mode] Changeset comment updated successfully.");
186190
} else {
187191
setOutput("comment_url", comment?.url);
188-
info("Changeset comment unchanged.");
192+
info("[Manual Mode] Changeset comment unchanged, skipping update.");
189193
}
190194

191195
setOutput("skipped", "false");
192196

193-
info("Changeset comment updated.");
194-
195197
return;
196198
}
197199

@@ -243,15 +245,18 @@ async function run() {
243245
actor && actor.length && actor !== "false"
244246
? actor
245247
: comment.editor || selection.approved_by;
246-
info(`[Normal Mode] Checkbox edit approved - using approver: ${approved_by}`);
248+
info(`[Normal Mode] Human checkbox edit approved - using approver: ${approved_by}`);
247249
} else if (approved) {
248250
approved_by = selection.approved_by;
249251
info(`[Normal Mode] Already approved - keeping approver: ${approved_by}`);
252+
} else {
253+
info(`[Normal Mode] Not approved (checkbox unchecked or never checked)`);
250254
}
251255
} else {
256+
// Bot edit or other non-checkbox edit - preserve existing state
252257
approved = selection.approved;
253258
approved_by = selection.approved_by;
254-
info(`[Normal Mode] Non-checkbox edit detected - preserving state:`);
259+
info(`[Normal Mode] Bot/non-checkbox edit detected - preserving existing state:`);
255260
info(` - Approved: ${approved}`);
256261
info(` - Approved by: ${approved_by || 'none'}`);
257262
}
@@ -329,22 +334,24 @@ async function run() {
329334
manual_package_selection,
330335
changeset_content,
331336
changeset_url: `https://github.com/${source_repo_name}/edit/${source_branch_name}/${changeset_path}`,
337+
previous_comment: comment?.body,
332338
approved,
333339
approved_by,
334340
changelog_entry_type: type || "unknown",
335341
});
336342

337-
// is pr body and generate body different?
343+
// Check if the comment needs updating
338344
if (changes) {
339-
info("Changeset comment updated.");
345+
info("[Normal Mode] Changeset comment has changes, updating...");
340346
const url = await client.upsert_comment({
341347
pr_id,
342348
body: pr_comment_content,
343349
comment_id: comment?.id,
344350
});
345351
setOutput("comment_url", url);
352+
info("[Normal Mode] Changeset comment updated successfully.");
346353
} else {
347-
info("Changeset comment unchanged.");
354+
info("[Normal Mode] Changeset comment unchanged, skipping update.");
348355
setOutput("comment_url", comment?.url);
349356
}
350357

0 commit comments

Comments
 (0)