lockdown.yml 1001 B

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Lockdown Issue & PR
  2. on:
  3. issues:
  4. types: [opened]
  5. issue_comment:
  6. types: [created]
  7. pull_request:
  8. types: [opened, synchronize, reopened]
  9. jobs:
  10. issueLockdown:
  11. if: ${{ github.event_name == 'issues' }}
  12. runs-on: ubuntu-latest
  13. permissions:
  14. issues: write
  15. steps:
  16. - name: Close & Lock Issue
  17. run: |
  18. gh issue close --reason "not planned" ${{ github.event.issue.number }}
  19. gh issue lock --reason "spam" ${{ github.event.issue.number }}
  20. env:
  21. GH_REPO: ${{ github.repository }}
  22. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  23. prLockdown:
  24. if: ${{ github.event_name == 'pull_request' }}
  25. runs-on: ubuntu-latest
  26. permissions:
  27. pull-requests: write
  28. steps:
  29. - name: Close & Lock PR
  30. run: |
  31. gh pr close ${{ github.event.pull_request.number }}
  32. gh pr lock ${{ github.event.pull_request.number }}
  33. env:
  34. GH_REPO: ${{ github.repository }}
  35. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}