Skip to content

Repository files navigation

lock

Release

Reusable GitHub Action for locking merged pull requests after a configurable delay.

Usage

name: Lock Merged PRson:
pull_request:
types: [closed]workflow_dispatch:
permissions:
pull-requests: writecontents: writejobs:
lock-merged:
if: github.event.pull_request.merged == trueruns-on: ubuntu-lateststeps:
- uses: libnudget/lock@v1with:
token: ${{ secrets.GITHUB_TOKEN }}

Inputs

NameRequiredDefaultNotes
tokenyesGitHub token with PR write access
days-before-lockno0Days after merge before locking
lock-reasonnoresolvedReason for locking (resolved, off-topic, duplicated, spam)
delete-branchnotrueDelete the branch after merging

What it does

  • Triggers when a PR is merged
  • Waits for the configured delay (default 1 day)
  • Locks the PR with the specified reason
  • Optionally deletes the merged branch

Notes

  • Uses workflow_dispatch for manual triggering
  • Requires pull-requests: write and contents: write permissions (write needed for branch deletion)

License

MIT

About

Locks merged pull requests.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors