[Nomination] Luis Fernando Solis Navarro #148
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' | |
| }); | |
| } |