PyTorch Ambassador K.A.S.M Maheeshakya #5
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 = 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' | |
| }); | |
| } |