Player ranks #15
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: Restrict issue creators and lock issue | |
| on: | |
| issues: | |
| types: [opened, reopened] | |
| permissions: | |
| issues: write | |
| jobs: | |
| lock: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Lock issue | |
| run: gh issue lock "${{ github.event.issue.number }}" -R "$GITHUB_REPOSITORY" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| restrict: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if creator is a maintainer | |
| id: check | |
| run: | | |
| if gh api orgs/BeaniumMC/teams/administrators/memberships/${{ github.event.sender.login }} --silent; then | |
| echo "is_maintainer=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_maintainer=false" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Close issues from non-maintainers | |
| if: steps.check.outputs.is_maintainer == 'false' | |
| run: | | |
| gh issue close "${{ github.event.issue.number }}" -R "$GITHUB_REPOSITORY" -c "Only roadmap maintainers can create issues." | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |