Skip to content

PyTorch Ambassador K.A.S.M Maheeshakya #5

PyTorch Ambassador K.A.S.M Maheeshakya

PyTorch Ambassador K.A.S.M Maheeshakya #5

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 = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.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: context.repo.owner,
repo: context.repo.repo,
issue_number: context.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."
});
// Lock the issue with 'resolved' reason
await github.rest.issues.lock({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
lock_reason: 'resolved'
});
}