This action locks a pull-request conversation.
permissions:
issues: write # lock the conversation
pull-requests: write # (optional) if the token also needs PR scopename: lock pull-request
on:
pull_request:
types:
- closed
jobs:
lock:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: lock pull request
uses: sudo-bot/action-pull-request-lock@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.pull_request.number }}
lock-reason: resolved- The action reads the inputs from the workflow.
- It calls the GitHub REST API to lock the issue/pull-request with the specified reason.
- If the API call fails, the action exits with a non-zero code and prints an error message.
