Skip to content

[Nomination] <Nominee Name> #137

[Nomination] <Nominee Name>

[Nomination] <Nominee Name> #137

name: "Auto-Lock Submissions"
on:
issues:
types:
- opened
jobs:
lock_issue:
runs-on: ubuntu-latest
steps:
- name: Auto-lock ambassador and feedback submissions
uses: actions/github-script@v7
with:
script: |
const issue_number = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const issue = await github.rest.issues.get({ owner, repo, issue_number });
const labels = issue.data.labels.map(label => label.name);
const shouldLock = labels.includes('ambassador') || labels.includes('feedback');
if (shouldLock) {
// Post the limitation notice before locking
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: "Please note: This conversation is now locked and limited to **PyTorch Foundation team members** only to maintain the integrity of the submission process."
});
// Add a small delay to ensure comment is posted before locking
await new Promise(resolve => setTimeout(resolve, 10000)); // 10-second delay
// Lock the issue with 'resolved' reason
await github.rest.issues.lock({
owner,
repo,
issue_number,
lock_reason: 'resolved'
});
}