Compare commits
54
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad0bb55c8c | ||
|
|
41136dedcc | ||
|
|
1d7245895f | ||
|
|
d89ff0361a | ||
|
|
37aee09843 | ||
|
|
1762f0f34c | ||
|
|
87777057d3 | ||
|
|
529464629f | ||
|
|
969dfd66f7 | ||
|
|
ad0789135f | ||
|
|
c43f50a8d8 | ||
|
|
e46e608f44 | ||
|
|
a3b3067fd6 | ||
|
|
9e944e2e46 | ||
|
|
308fded1f7 | ||
|
|
93ec667406 | ||
|
|
7f96bc9f63 | ||
|
|
b043faec3a | ||
|
|
ce9da6a7ee | ||
|
|
c323e8f9fe | ||
|
|
dfc2edafc7 | ||
|
|
68835ec1ab | ||
|
|
52f1795b6c | ||
|
|
40c2bfa514 | ||
|
|
08adfc45a5 | ||
|
|
c53794701f | ||
|
|
7957303b4c | ||
|
|
74d9c81245 | ||
|
|
cc3f85d9e4 | ||
|
|
dbbcfa2bfe | ||
|
|
324bc53099 | ||
|
|
dafc9768c3 | ||
|
|
cdc37bb412 | ||
|
|
b50c3603af | ||
|
|
d99467b4ae | ||
|
|
64e5cbb3d6 | ||
|
|
65f2c97a3e | ||
|
|
754ce9fc72 | ||
|
|
3791f34e08 | ||
|
|
051a5cc8b5 | ||
|
|
2f76987bd9 | ||
|
|
7b012e7f55 | ||
|
|
61bc9d45c2 | ||
|
|
5b286d9fe2 | ||
|
|
0cc2eaba8f | ||
|
|
faa8fd6950 | ||
|
|
c842419620 | ||
|
|
5e09be253f | ||
|
|
3c5b7b7c2f | ||
|
|
9b95825a23 | ||
|
|
63c9553dab | ||
|
|
4875568f8d | ||
|
|
a7e5c95029 | ||
|
|
ee98793e47 |
No files matched your search
@@ -34,7 +34,7 @@ jobs:
|
|||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Audit production dependencies
|
- name: Audit production dependencies
|
||||||
run: pnpm audit --prod --audit-level=high
|
run: pnpm audit --prod --audit-level=high --ignore-unfixable
|
||||||
|
|
||||||
- name: Build Nitro app
|
- name: Build Nitro app
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
@@ -1,38 +1,217 @@
|
|||||||
name: Dependabot Auto Merge
|
name: Dependabot Auto Merge
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
schedule:
|
||||||
|
- cron: "43 3 * * *"
|
||||||
|
check_suite:
|
||||||
|
types: [completed]
|
||||||
|
workflow_run:
|
||||||
|
workflows:
|
||||||
|
- "CI"
|
||||||
|
- "CodeQL"
|
||||||
|
- "Dependabot Updates"
|
||||||
types:
|
types:
|
||||||
- opened
|
- completed
|
||||||
- synchronize
|
workflow_dispatch:
|
||||||
- reopened
|
|
||||||
- labeled
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
checks: read
|
||||||
|
statuses: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
enable-automerge:
|
merge:
|
||||||
if: github.event.pull_request.user.login == 'dependabot[bot]'
|
name: Auto-merge Dependabot PRs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch Dependabot metadata
|
- name: Merge Dependabot PRs when checks pass
|
||||||
id: metadata
|
uses: actions/github-script@v9
|
||||||
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
|
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
script: |
|
||||||
|
const owner = context.repo.owner;
|
||||||
|
const repo = context.repo.repo;
|
||||||
|
|
||||||
- name: Enable auto-merge for patch updates
|
const successfulCheckConclusions = new Set(["success", "skipped", "neutral"]);
|
||||||
if: |
|
const successfulStatusStates = new Set(["success"]);
|
||||||
(github.event.pull_request.base.ref == 'main') &&
|
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
(
|
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
|
const latestBy = (items, keyOf, timeOf) => {
|
||||||
steps.metadata.outputs.update-type == 'security:update'
|
const latest = new Map();
|
||||||
)
|
for (const item of items) {
|
||||||
run: gh pr merge --auto --merge "$PR_URL"
|
const key = keyOf(item);
|
||||||
env:
|
const itemTime = new Date(timeOf(item) || 0).getTime();
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
const existing = latest.get(key);
|
||||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
const existingTime = existing ? new Date(timeOf(existing) || 0).getTime() : -1;
|
||||||
|
if (!existing || itemTime >= existingTime) {
|
||||||
|
latest.set(key, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [...latest.values()];
|
||||||
|
};
|
||||||
|
|
||||||
|
const findCandidatePulls = async () => {
|
||||||
|
const branch = context.payload.workflow_run?.head_branch;
|
||||||
|
if (context.eventName === "workflow_run" && branch) {
|
||||||
|
const { data: pulls } = await github.rest.pulls.list({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
state: "open",
|
||||||
|
head: owner + ":" + branch,
|
||||||
|
per_page: 10,
|
||||||
|
});
|
||||||
|
|
||||||
|
return pulls.filter((pr) => pr.user?.login === "dependabot[bot]");
|
||||||
|
}
|
||||||
|
|
||||||
|
const pulls = await github.paginate(github.rest.pulls.list, {
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
state: "open",
|
||||||
|
per_page: 100,
|
||||||
|
});
|
||||||
|
|
||||||
|
return pulls.filter((pr) => pr.user?.login === "dependabot[bot]");
|
||||||
|
};
|
||||||
|
|
||||||
|
const getMergeablePullRequest = async (pull_number) => {
|
||||||
|
for (let attempt = 1; attempt <= 6; attempt += 1) {
|
||||||
|
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
|
||||||
|
if (pr.mergeable !== null) {
|
||||||
|
return pr;
|
||||||
|
}
|
||||||
|
core.info("PR #" + pull_number + " mergeability is still being computed; retry " + attempt + "/6.");
|
||||||
|
await wait(5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
|
||||||
|
return pr;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSignalState = async (sha) => {
|
||||||
|
const checkRuns = await github.paginate(github.rest.checks.listForRef, {
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
ref: sha,
|
||||||
|
per_page: 100,
|
||||||
|
});
|
||||||
|
|
||||||
|
const statuses = await github.paginate(github.rest.repos.listCommitStatusesForRef, {
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
ref: sha,
|
||||||
|
per_page: 100,
|
||||||
|
});
|
||||||
|
|
||||||
|
const latestChecks = latestBy(
|
||||||
|
checkRuns.filter((run) => run.name !== "Dependabot Auto Merge"),
|
||||||
|
(run) => (run.app?.slug || "unknown") + ":" + run.name,
|
||||||
|
(run) => run.completed_at || run.started_at || run.created_at,
|
||||||
|
);
|
||||||
|
const latestStatuses = latestBy(statuses, (status) => status.context, (status) => status.updated_at || status.created_at);
|
||||||
|
|
||||||
|
const pendingChecks = latestChecks.filter((run) => run.status !== "completed");
|
||||||
|
const failedChecks = latestChecks.filter(
|
||||||
|
(run) => run.status === "completed" && !successfulCheckConclusions.has(String(run.conclusion || "").toLowerCase()),
|
||||||
|
);
|
||||||
|
const failedStatuses = latestStatuses.filter((status) => !successfulStatusStates.has(String(status.state || "").toLowerCase()));
|
||||||
|
|
||||||
|
return {
|
||||||
|
totalSignals: latestChecks.length + latestStatuses.length,
|
||||||
|
pendingChecks,
|
||||||
|
failedChecks,
|
||||||
|
failedStatuses,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data: repository } = await github.rest.repos.get({ owner, repo });
|
||||||
|
const mergeMethods = [];
|
||||||
|
if (repository.allow_merge_commit) mergeMethods.push("merge");
|
||||||
|
if (repository.allow_squash_merge) mergeMethods.push("squash");
|
||||||
|
if (repository.allow_rebase_merge) mergeMethods.push("rebase");
|
||||||
|
|
||||||
|
if (mergeMethods.length === 0) {
|
||||||
|
core.info("This repository has no enabled pull request merge methods.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pulls = await findCandidatePulls();
|
||||||
|
if (pulls.length === 0) {
|
||||||
|
core.info("No open Dependabot PRs to evaluate.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const candidate of pulls) {
|
||||||
|
const pull_number = candidate.number;
|
||||||
|
const pr = await getMergeablePullRequest(pull_number);
|
||||||
|
|
||||||
|
if (pr.user?.login !== "dependabot[bot]") {
|
||||||
|
core.info("PR #" + pull_number + " is no longer a Dependabot PR.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pr.state !== "open" || pr.draft) {
|
||||||
|
core.info("PR #" + pull_number + " is not an open, ready PR.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pr.mergeable !== true) {
|
||||||
|
core.info("PR #" + pull_number + " is not currently mergeable.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const signalState = await getSignalState(pr.head.sha);
|
||||||
|
if (signalState.totalSignals === 0) {
|
||||||
|
core.info("PR #" + pull_number + " has no checks or statuses yet; skipping.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (signalState.pendingChecks.length > 0) {
|
||||||
|
core.info("PR #" + pull_number + " still has pending checks: " + signalState.pendingChecks.map((run) => run.name).join(", ") + ".");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (signalState.failedChecks.length > 0 || signalState.failedStatuses.length > 0) {
|
||||||
|
const failedChecks = signalState.failedChecks.map((run) => run.name + "=" + run.conclusion).join(", ");
|
||||||
|
const failedStatuses = signalState.failedStatuses.map((status) => status.context + "=" + status.state).join(", ");
|
||||||
|
core.info("PR #" + pull_number + " is not green. Checks: " + (failedChecks || "none") + ". Statuses: " + (failedStatuses || "none") + ".");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let merged = false;
|
||||||
|
let lastError = null;
|
||||||
|
for (const merge_method of mergeMethods) {
|
||||||
|
try {
|
||||||
|
await github.rest.pulls.merge({ owner, repo, pull_number, merge_method });
|
||||||
|
core.info("Merged Dependabot PR #" + pull_number + " with " + merge_method + ".");
|
||||||
|
merged = true;
|
||||||
|
break;
|
||||||
|
} catch (error) {
|
||||||
|
lastError = error;
|
||||||
|
if (error.status === 403 || error.status === 405 || error.status === 409) {
|
||||||
|
core.info("Cannot merge PR #" + pull_number + " with " + merge_method + ": " + error.message);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!merged) {
|
||||||
|
core.info("PR #" + pull_number + " could not be merged: " + (lastError?.message || "unknown error") + ".");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pr.head.repo?.full_name === owner + "/" + repo) {
|
||||||
|
try {
|
||||||
|
await github.rest.git.deleteRef({ owner, repo, ref: "heads/" + pr.head.ref });
|
||||||
|
core.info("Deleted branch " + pr.head.ref + ".");
|
||||||
|
} catch (error) {
|
||||||
|
core.info("Could not delete branch " + pr.head.ref + ": " + error.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
export default defineNitroConfig({
|
export default defineNitroConfig({
|
||||||
compatibilityDate: "2026-03-17",
|
compatibilityDate: "2026-03-17",
|
||||||
routeRules: {
|
routeRules: {
|
||||||
|
"/google/**": {
|
||||||
|
proxy: "https://translate.googleapis.com/**",
|
||||||
|
},
|
||||||
"/**": {
|
"/**": {
|
||||||
proxy: "https://www2.deepl.com/**",
|
proxy: "https://www2.deepl.com/**",
|
||||||
},
|
},
|
||||||
|
|||||||
+3
-2
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"packageManager": "pnpm@10.32.1",
|
"packageManager": "pnpm@10.32.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nitropack": "2.13.1"
|
"nitropack": "2.13.4"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"serialize-javascript": "7.0.5"
|
"serialize-javascript": "7.0.5",
|
||||||
|
"esbuild": "0.28.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
Generated
+893
-833
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user