Skip to content
name: Close Pull Requests and Issues
on:
pull_request:
types: [opened]
issues:
types: [opened]
jobs:
close_pull_requests:
runs-on: ubuntu-latest
steps:
- name: Close Pull Request
run: |
gh pr close ${{ github.event.pull_request.html_url }} -c "This repository is read-only and managed by a bot. Pull requests are not accepted."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lock_pull_requests:
runs-on: ubuntu-latest
steps:
- name: Lock Pull Request
uses: dessant/lock-threads@v2
with:
issue-lock-labels: 'locked'
lock-reason: 'resolved'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
close_issues:
runs-on: ubuntu-latest
steps:
- name: Close Issue
run: |
gh issue close ${{ github.event.issue.html_url }} -c "This repository is read-only and managed by a bot. Issues are not accepted."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lock_issues:
runs-on: ubuntu-latest
steps:
- name: Lock Issue
uses: dessant/lock-threads@v2
with:
issue-lock-labels: 'locked'
lock-reason: 'resolved'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}