All Projects → dessant → Lock Threads

dessant / Lock Threads

Licence: mit
GitHub Action that locks closed issues and pull requests after a period of inactivity

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Lock Threads

Repo Lockdown
GitHub Action that immediately closes and locks issues and pull requests
Stars: ✭ 56 (-64.1%)
Mutual labels:  pull-requests, issues, lock
aloba
🤖 [Myrmica Aloba 🐜] Bot: Add labels and milestone on pull requests and issues.
Stars: ✭ 18 (-88.46%)
Mutual labels:  issues, pull-requests
release-changelog-builder-action
A GitHub action that builds your release notes / changelog fast, easy and exactly the way you want.
Stars: ✭ 515 (+230.13%)
Mutual labels:  issues, pull-requests
Github Project Automation Plus
🤖 Automate GitHub Project cards with any webhook event
Stars: ✭ 134 (-14.1%)
Mutual labels:  pull-requests, issues
Github Issue Templates
🔣 A collection of GitHub issue and pull request templates
Stars: ✭ 3,074 (+1870.51%)
Mutual labels:  pull-requests, issues
assign-author
GitHub Actions to assign author to issue or PR
Stars: ✭ 55 (-64.74%)
Mutual labels:  issues, pull-requests
label-actions
🤖 GitHub Action that performs certain tasks when issues, pull requests or discussions are labeled or unlabeled
Stars: ✭ 60 (-61.54%)
Mutual labels:  issues, lock
backup-github-repo
Backup all the issues and pull requests of a Github repo, including the comments, events, and labels, as JSON and as HTML
Stars: ✭ 31 (-80.13%)
Mutual labels:  issues, pull-requests
Contributors On Github
🌵 Show stats about contributors on github
Stars: ✭ 391 (+150.64%)
Mutual labels:  pull-requests, issues
Github Bot
GitHub 自动处理 issue、PR、releases 机器人
Stars: ✭ 434 (+178.21%)
Mutual labels:  pull-requests, issues
Contribute A Thon
Month-long Open Source contributing event ✨
Stars: ✭ 26 (-83.33%)
Mutual labels:  pull-requests, issues
Gha Mjolnir
🔨 GitHub Action to close issues related to the merge of a pull request.
Stars: ✭ 28 (-82.05%)
Mutual labels:  pull-requests, issues
Export Pull Requests
Export pull requests and/or issues to a CSV file. Supports GitHub, GitLab, and Bitbucket
Stars: ✭ 68 (-56.41%)
Mutual labels:  pull-requests, issues
Lock.android
Android Library to authenticate using Auth0 and with a Native Look & Feel
Stars: ✭ 121 (-22.44%)
Mutual labels:  lock
Node Proper Lockfile
An inter-process and inter-machine lockfile utility that works on a local or network file system.
Stars: ✭ 139 (-10.9%)
Mutual labels:  lock
Gitpay
Bounties for issues on demand. Be rewarded by learning, using Git workflow and continuous integration
Stars: ✭ 121 (-22.44%)
Mutual labels:  pull-requests
Acyort
A Node.js static website framework
Stars: ✭ 118 (-24.36%)
Mutual labels:  issues
Gh Polls
These polls work by pasting individual markdown SVG images into your issue, each wrapped with a link that tracks a vote. A single vote per IP is allowed for a given poll, which are stored in DynamoDB.
Stars: ✭ 1,726 (+1006.41%)
Mutual labels:  issues
Illacceptanything
The project where literally anything* goes.
Stars: ✭ 1,756 (+1025.64%)
Mutual labels:  pull-requests
Live Mutex
High-performance networked mutex for Node.js libraries.
Stars: ✭ 118 (-24.36%)
Mutual labels:  lock

Lock Threads

Lock Threads is a GitHub Action that locks closed issues and pull requests after a period of inactivity.

The legacy version of this project can be found here.

Supporting the Project

The continued development of Lock Threads is made possible thanks to the support of awesome backers. If you'd like to join them, please consider contributing with Patreon, PayPal or Bitcoin.

Usage

Create a lock.yml workflow file in the .github/workflows directory, use one of the example workflows to get started.

Inputs

The action can be configured using input parameters. All parameters are optional, except github-token.

  • github-token
    • GitHub access token, value must be ${{ github.token }}
    • Required
  • issue-lock-inactive-days
    • Number of days of inactivity before a closed issue is locked
    • Optional, defaults to 365
  • issue-exclude-created-before
    • Do not lock issues created before a given timestamp, value must follow ISO 8601
    • Optional, defaults to ''
  • issue-exclude-labels
    • Do not lock issues with these labels, value must be a comma separated list of labels or ''
    • Optional, defaults to ''
  • issue-lock-labels
    • Labels to add before locking an issue, value must be a comma separated list of labels or ''
    • Optional, defaults to ''
  • issue-lock-comment
    • Comment to post before locking an issue
    • Optional, defaults to ''
  • issue-lock-reason
    • Reason for locking an issue, value must be one of resolved, off-topic, too heated, spam or ''
    • Optional, defaults to resolved
  • pr-lock-inactive-days
    • Number of days of inactivity before a closed pull request is locked
    • Optional, defaults to 365
  • pr-exclude-created-before
    • Do not lock pull requests created before a given timestamp, value must follow ISO 8601
    • Optional, defaults to ''
  • pr-exclude-labels
    • Do not lock pull requests with these labels, value must be a comma separated list of labels or ''
    • Optional, defaults to ''
  • pr-lock-labels
    • Labels to add before locking a pull request, value must be a comma separated list of labels or ''
    • Optional, defaults to ''
  • pr-lock-comment
    • Comment to post before locking a pull request
    • Optional, defaults to ''
  • pr-lock-reason
    • Reason for locking a pull request, value must be one of resolved, off-topic, too heated, spam or ''
    • Optional, defaults to resolved
  • process-only
    • Limit locking to only issues or pull requests, value must be one of issues, prs or ''
    • Optional, defaults to ''

Outputs

  • issues
    • Issues that have been locked, value is a JSON string in the form of [{"owner": "actions", "repo": "toolkit", "issue_number": 1}]
    • Defaults to ''
  • prs
    • Pull requests that have been locked, value is a JSON string in the form of [{"owner": "actions", "repo": "toolkit", "issue_number": 1}]
    • Defaults to ''

Examples

The following workflow will search once an hour for closed issues and pull requests that can be locked.

name: 'Lock Threads'

on:
  schedule:
    - cron: '0 * * * *'

jobs:
  lock:
    runs-on: ubuntu-latest
    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}

Edit the workflow after the initial backlog of issues and pull requests has been processed to reduce the frequency of scheduled runs. Running the workflow only once a day helps reduce resource usage.

on:
  schedule:
    - cron: '0 0 * * *'

Available input parameters

This workflow declares all the available input parameters of the action and their default values. Any of the parameters can be omitted, except github-token.

name: 'Lock Threads'

on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  lock:
    runs-on: ubuntu-latest
    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}
          issue-lock-inactive-days: '365'
          issue-exclude-created-before: ''
          issue-exclude-labels: ''
          issue-lock-labels: ''
          issue-lock-comment: ''
          issue-lock-reason: 'resolved'
          pr-lock-inactive-days: '365'
          pr-exclude-created-before: ''
          pr-exclude-labels: ''
          pr-lock-labels: ''
          pr-lock-comment: ''
          pr-lock-reason: 'resolved'
          process-only: ''

Excluding issues and pull requests

This step will lock only issues, and exclude issues created before 2018, or those with the upstream or help-wanted labels applied.

    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}
          issue-exclude-created-before: '2018-01-01T00:00:00Z'
          issue-exclude-labels: 'upstream, help-wanted'
          process-only: 'issues'

This step will lock only pull requests, and exclude those with the wip label applied.

    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}
          pr-exclude-labels: 'wip'
          process-only: 'prs'

Commenting and labeling

This step will post a comment on issues and pull requests before locking them, and apply the outdated label to issues.

    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}
          issue-lock-labels: 'outdated'
          issue-lock-comment: >
            This issue has been automatically locked since there
            has not been any recent activity after it was closed.
            Please open a new issue for related bugs.
          pr-lock-comment: >
            This pull request has been automatically locked since there
            has not been any recent activity after it was closed.
            Please open a new issue for related bugs.

How are issues and pull requests determined to be inactive?

The action uses GitHub's updated search qualifier to determine inactivity. Any change to an issue or pull request is considered an update, including comments, changing labels, applying or removing milestones, or pushing commits.

An easy way to check and see which issues or pull requests will initially be locked is to add the updated search qualifier to either the issue or pull request page filter for your repository: is:closed is:unlocked updated:<2018-12-20. Adjust the date to be 365 days ago (or whatever you set for *-lock-inactive-days) to see which issues or pull requests will be locked.

Why are only some issues and pull requests processed?

To avoid triggering abuse prevention mechanisms on GitHub, only 50 issues and pull requests will be handled at once. If your repository has more than that, it will just take a few hours or days to process them all.

License

Copyright (c) 2017-2021 Armin Sebastian

This software is released under the terms of the MIT License. See the LICENSE file for further information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].