mirror of
https://github.com/hwchase17/langchain.git
synced 2026-07-13 12:14:06 +00:00
Bumps the major group with 1 update in the / directory: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6.0.2 to 7.0.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v7.0.0</h2> <h2>What's Changed</h2> <ul> <li>block checking out fork pr for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> <li>getting ready for checkout v7 release by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2464">actions/checkout#2464</a></li> <li>update error wording by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2467">actions/checkout#2467</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6.0.3...v7.0.0">https://github.com/actions/checkout/compare/v6.0.3...v7.0.0</a></p> <h2>v6.0.3</h2> <h2>What's Changed</h2> <ul> <li>Update changelog by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2357">actions/checkout#2357</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>Update changelog for v6.0.3 by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2446">actions/checkout#2446</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/yaananth"><code>@yaananth</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6...v6.0.3">https://github.com/actions/checkout/compare/v6...v6.0.3</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v7.0.0</h2> <ul> <li>Block checking out fork PR for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> </ul> <h2>v6.0.3</h2> <ul> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="9c091bb21b"><code>9c091bb</code></a> update error wording (<a href="https://redirect.github.com/actions/checkout/issues/2467">#2467</a>)</li> <li><a href="1044a6dea9"><code>1044a6d</code></a> getting ready for checkout v7 release (<a href="https://redirect.github.com/actions/checkout/issues/2464">#2464</a>)</li> <li><a href="f0282184c7"><code>f028218</code></a> Bump the minor-npm-dependencies group across 1 directory with 3 updates (<a href="https://redirect.github.com/actions/checkout/issues/2462">#2462</a>)</li> <li><a href="d914b262ff"><code>d914b26</code></a> upgrade module to esm and update dependencies (<a href="https://redirect.github.com/actions/checkout/issues/2463">#2463</a>)</li> <li><a href="537c7ef99c"><code>537c7ef</code></a> Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid (<a href="https://redirect.github.com/actions/checkout/issues/2459">#2459</a>)</li> <li><a href="130a169078"><code>130a169</code></a> Bump js-yaml from 4.1.0 to 4.2.0 (<a href="https://redirect.github.com/actions/checkout/issues/2461">#2461</a>)</li> <li><a href="7d09575332"><code>7d09575</code></a> Bump flatted from 3.3.1 to 3.4.2 (<a href="https://redirect.github.com/actions/checkout/issues/2460">#2460</a>)</li> <li><a href="0f9f3aa320"><code>0f9f3aa</code></a> Bump actions/publish-immutable-action (<a href="https://redirect.github.com/actions/checkout/issues/2458">#2458</a>)</li> <li><a href="f9e715a95f"><code>f9e715a</code></a> block checking out fork pr for pull_request_target and workflow_run (<a href="https://redirect.github.com/actions/checkout/issues/2454">#2454</a>)</li> <li><a href="df4cb1c069"><code>df4cb1c</code></a> Update changelog for v6.0.3 (<a href="https://redirect.github.com/actions/checkout/issues/2446">#2446</a>)</li> <li>Additional commits viewable in <a href="de0fac2e45...9c091bb21b">compare view</a></li> </ul> </details> <br /> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
197 lines
8.6 KiB
YAML
197 lines
8.6 KiB
YAML
# Auto-close issues that bypass or ignore the issue template checkboxes.
|
||
#
|
||
# GitHub issue forms enforce `required: true` checkboxes in the web UI,
|
||
# but the API bypasses form validation entirely — bots/scripts can open
|
||
# issues with every box unchecked or skip the template altogether.
|
||
#
|
||
# Rules:
|
||
# 0. No issue type -> close unless author is an org member
|
||
# 1. No checkboxes at all -> close unless author is an org member or bot
|
||
# 2. Checkboxes present but none checked -> close
|
||
# 3. "Submission checklist" section incomplete -> close
|
||
# 4. "Package (Required)" section has no selection -> close
|
||
#
|
||
# Org membership check reuses the shared helper from pr-labeler.js and
|
||
# the same GitHub App used by tag-external-issues.yml.
|
||
|
||
name: Close Unchecked Issues
|
||
|
||
on:
|
||
issues:
|
||
types: [opened]
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
concurrency:
|
||
group: ${{ github.workflow }}-${{ github.event.issue.number }}
|
||
cancel-in-progress: true
|
||
|
||
jobs:
|
||
check-boxes:
|
||
runs-on: ubuntu-latest
|
||
permissions:
|
||
contents: read
|
||
issues: write
|
||
|
||
steps:
|
||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
|
||
|
||
- name: Generate GitHub App token
|
||
id: app-token
|
||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
|
||
with:
|
||
client-id: ${{ secrets.ORG_MEMBERSHIP_APP_CLIENT_ID }}
|
||
private-key: ${{ secrets.ORG_MEMBERSHIP_APP_PRIVATE_KEY }}
|
||
|
||
- name: Validate issue checkboxes
|
||
if: steps.app-token.outcome == 'success'
|
||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||
with:
|
||
github-token: ${{ steps.app-token.outputs.token }}
|
||
script: |
|
||
const { owner, repo } = context.repo;
|
||
const issue_number = context.payload.issue.number;
|
||
const body = context.payload.issue.body ?? '';
|
||
const allChecked = (body.match(/- \[x\]/gi) || []).length;
|
||
const allUnchecked = (body.match(/- \[ \]/g) || []).length;
|
||
const total = allChecked + allUnchecked;
|
||
|
||
// ── Helpers ─────────────────────────────────────────────────
|
||
// Extract checkboxes under a markdown H2/H3 heading.
|
||
// Returns { checked, unchecked } counts, or null if the
|
||
// section heading is not found in the body.
|
||
function parseSection(heading) {
|
||
const escaped = heading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||
// Find the heading line
|
||
const headingRe = new RegExp(`^#{2,3}\\s+${escaped}\\s*$`, 'm');
|
||
const headingMatch = headingRe.exec(body);
|
||
if (!headingMatch) return null;
|
||
// Slice from after the heading to the next heading or end
|
||
const rest = body.slice(headingMatch.index + headingMatch[0].length);
|
||
const nextHeading = rest.search(/\n#{2,3}\s/);
|
||
const block = nextHeading === -1 ? rest : rest.slice(0, nextHeading);
|
||
return {
|
||
checked: (block.match(/- \[x\]/gi) || []).length,
|
||
unchecked: (block.match(/- \[ \]/g) || []).length,
|
||
};
|
||
}
|
||
|
||
let _cachedMember;
|
||
async function isOrgMember() {
|
||
if (_cachedMember) return _cachedMember;
|
||
const { h } = require('./.github/scripts/pr-labeler.js')
|
||
.loadAndInit(github, owner, repo, core);
|
||
const author = context.payload.sender.login;
|
||
const { isExternal } = await h.checkMembership(
|
||
author, context.payload.sender.type,
|
||
);
|
||
_cachedMember = { internal: !isExternal, author };
|
||
return _cachedMember;
|
||
}
|
||
|
||
async function closeWithComment(lines) {
|
||
const templateUrl = `https://github.com/${owner}/${repo}/issues/new/choose`;
|
||
lines.push(
|
||
'',
|
||
`Please use one of the [issue templates](${templateUrl}).`,
|
||
);
|
||
|
||
// Post comment first so the author sees the reason even if
|
||
// the subsequent close call fails.
|
||
await github.rest.issues.createComment({
|
||
owner, repo, issue_number,
|
||
body: lines.join('\n'),
|
||
});
|
||
|
||
await github.rest.issues.update({
|
||
owner, repo, issue_number,
|
||
state: 'closed',
|
||
state_reason: 'not_planned',
|
||
});
|
||
}
|
||
|
||
// ── Rule 0: no issue type (API/CLI bypass) ──────────────────
|
||
// Issue types are set automatically when using web UI templates.
|
||
// External users cannot set issue types via the API (requires
|
||
// write/triage permissions), so a missing type reliably indicates
|
||
// programmatic submission.
|
||
if (!context.payload.issue.type) {
|
||
let membership;
|
||
try {
|
||
membership = await isOrgMember();
|
||
} catch (e) {
|
||
// Org membership check failed — skip Rule 0 and let
|
||
// Rules 1-4 handle validation via checkboxes.
|
||
core.warning(`Rule 0: org membership check failed, skipping: ${e.message}`);
|
||
}
|
||
if (membership?.internal) {
|
||
console.log(`No issue type, but ${membership.author} is internal — OK`);
|
||
} else if (membership) {
|
||
console.log(`No issue type and ${membership.author} is external — closing`);
|
||
await closeWithComment([
|
||
'This issue was automatically closed because it appears to have been submitted programmatically — issue types are automatically set when using the GitHub web interface, and this issue has none.',
|
||
'',
|
||
'We do not allow automated issue submission at this time.',
|
||
]);
|
||
return;
|
||
}
|
||
}
|
||
|
||
// ── Rule 1: no checkboxes at all ────────────────────────────
|
||
if (total === 0) {
|
||
const { internal, author } = await isOrgMember();
|
||
if (internal) {
|
||
console.log(`No checkboxes, but ${author} is internal — OK`);
|
||
return;
|
||
}
|
||
console.log(`No checkboxes and ${author} is external — closing`);
|
||
await closeWithComment([
|
||
'This issue was automatically closed because no issue template was used.',
|
||
]);
|
||
return;
|
||
}
|
||
|
||
// ── Rule 2: checkboxes present but none checked ─────────────
|
||
if (allChecked === 0) {
|
||
console.log(`${allUnchecked} checkbox(es) present, none checked — closing`);
|
||
await closeWithComment([
|
||
'This issue was automatically closed because none of the required checkboxes were checked. Please re-file using an issue template and complete the checklist.',
|
||
]);
|
||
return;
|
||
}
|
||
|
||
// ── Rules 3–4: parse sections for targeted feedback ─────────
|
||
const checklist = parseSection('Submission checklist');
|
||
const pkg = parseSection('Package (Required)');
|
||
console.log(`Section parse — checklist: ${JSON.stringify(checklist)}, pkg: ${JSON.stringify(pkg)}`);
|
||
|
||
const problems = [];
|
||
|
||
if (checklist && checklist.unchecked > 0) {
|
||
problems.push(
|
||
'the submission checklist is incomplete — please confirm you searched for duplicates, included a reproduction, etc.'
|
||
);
|
||
}
|
||
if (pkg !== null && pkg.checked === 0) {
|
||
problems.push(
|
||
'no package was selected (e.g. langchain-core, langchain, langgraph) — this helps us route the issue to the right team'
|
||
);
|
||
} else if (pkg === null) {
|
||
problems.push(
|
||
'the package selection is missing (e.g. langchain-core, langchain, langgraph) — this helps us route the issue to the right team'
|
||
);
|
||
}
|
||
|
||
if (problems.length === 0) {
|
||
console.log(`All section checks passed (${allChecked} checked) — OK`);
|
||
return;
|
||
}
|
||
|
||
console.log(`Closing — problems: ${problems.join('; ')}`);
|
||
await closeWithComment([
|
||
'Thanks for opening an issue! It was automatically closed because:',
|
||
'',
|
||
...problems.map(p => `- ${p}`),
|
||
]);
|