All Projects → dessant → Repo Lockdown

dessant / Repo Lockdown

Licence: mit
GitHub Action that immediately closes and locks issues and pull requests

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Repo Lockdown

Lock Threads
GitHub Action that locks closed issues and pull requests after a period of inactivity
Stars: ✭ 156 (+178.57%)
Mutual labels:  pull-requests, issues, lock
Github Issue Templates
🔣 A collection of GitHub issue and pull request templates
Stars: ✭ 3,074 (+5389.29%)
Mutual labels:  pull-requests, issues
Github Project Automation Plus
🤖 Automate GitHub Project cards with any webhook event
Stars: ✭ 134 (+139.29%)
Mutual labels:  pull-requests, issues
assign-author
GitHub Actions to assign author to issue or PR
Stars: ✭ 55 (-1.79%)
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 (+819.64%)
Mutual labels:  issues, pull-requests
Export Pull Requests
Export pull requests and/or issues to a CSV file. Supports GitHub, GitLab, and Bitbucket
Stars: ✭ 68 (+21.43%)
Mutual labels:  pull-requests, issues
aloba
🤖 [Myrmica Aloba 🐜] Bot: Add labels and milestone on pull requests and issues.
Stars: ✭ 18 (-67.86%)
Mutual labels:  issues, pull-requests
Github Bot
GitHub 自动处理 issue、PR、releases 机器人
Stars: ✭ 434 (+675%)
Mutual labels:  pull-requests, issues
Contributors On Github
🌵 Show stats about contributors on github
Stars: ✭ 391 (+598.21%)
Mutual labels:  pull-requests, issues
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 (-44.64%)
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 (+7.14%)
Mutual labels:  issues, lock
Contribute A Thon
Month-long Open Source contributing event ✨
Stars: ✭ 26 (-53.57%)
Mutual labels:  pull-requests, issues
Mirror
A blogging tool powered by GitHub API. Write your blog on GitHub issue.
Stars: ✭ 590 (+953.57%)
Mutual labels:  issues, mirror
Gha Mjolnir
🔨 GitHub Action to close issues related to the merge of a pull request.
Stars: ✭ 28 (-50%)
Mutual labels:  pull-requests, issues
Blog
github issues reactjs blog
Stars: ✭ 27 (-51.79%)
Mutual labels:  issues
Zeit
Qt frontend to at & crontab CLI utilities
Stars: ✭ 42 (-25%)
Mutual labels:  mirror
Lab
Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
Stars: ✭ 911 (+1526.79%)
Mutual labels:  fork
Dyfauthidandgesturelock
手势密码解锁和 TouchID (指纹) / FaceID(面容) 解锁,代码简洁高效。(Gesture passcode unlocking and TouchID (fingerprint) / FaceID (facial features) unlocking, its code is concise and efficient.) https://github.com/dgynfi/DYFAuthIDAndGestureLock
Stars: ✭ 20 (-64.29%)
Mutual labels:  lock
Angelscript Mirror
Unofficial mirror for Angelscript's SVN repository, updated hourly.
Stars: ✭ 49 (-12.5%)
Mutual labels:  mirror
Github Review Filter
Chrome extension to filter files in GitHub code review using glob
Stars: ✭ 42 (-25%)
Mutual labels:  pull-requests

Repo Lockdown

Repo Lockdown is a GitHub Action that immediately closes and locks issues and pull requests. It is mainly used with repositories that do not accept issues or pull requests, such as forks and mirrors.

The legacy version of this project can be found here.

Supporting the Project

The continued development of Repo Lockdown 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 lockdown.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
  • exclude-issue-created-before
    • Do not process issues created before a given timestamp, value must follow ISO 8601
    • Optional, defaults to ''
  • exclude-issue-labels
    • Do not process issues with these labels, value must be a comma separated list of labels
    • Optional, defaults to ''
  • issue-labels
    • Labels to add before closing or locking an issue, value must be a comma separated list of labels
    • Optional, defaults to ''
  • issue-comment
    • Comment to post before closing or locking an issue
    • Optional, defaults to ''
  • skip-closed-issue-comment
    • Do not comment on already closed issues before locking, value must be either true or false
    • Optional, defaults to false
  • close-issue
    • Close issues, value must be either true or false
    • Optional, defaults to true
  • lock-issue
    • Lock issues, value must be either true or false
    • Optional, defaults to true
  • issue-lock-reason
    • Reason for locking an issue, value must be one of resolved, off-topic, too heated or spam
    • Optional, defaults to ''
  • exclude-pr-created-before
    • Do not process pull requests created before a given timestamp, value must follow ISO 8601
    • Optional, defaults to ''
  • exclude-pr-labels
    • Do not process pull requests with these labels, value must be a comma separated list of labels
    • Optional, defaults to ''
  • pr-labels
    • Labels to add before closing or locking a pull request, value must be a comma separated list of labels
    • Optional, defaults to ''
  • pr-comment
    • Comment to post before closing or locking a pull request
    • Optional, defaults to ''
  • skip-closed-pr-comment
    • Do not comment on already closed pull requests before locking, value must be either true or false
    • Optional, defaults to false
  • close-pr
    • Close pull requests, value must be either true or false
    • Optional, defaults to true
  • lock-pr
    • Lock pull requests, value must be either true or false
    • Optional, defaults to true
  • pr-lock-reason
    • Reason for locking a pull request, value must be one of resolved, off-topic, too heated or spam
    • Optional, defaults to ''
  • process-only
    • Process only issues or pull requests, value must be either issues or prs
    • Optional, defaults to ''

Outputs

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

Examples

The following workflow will search once an hour for existing issues and pull requests that can be closed or locked. New issues and pull requests will be immediately processed when they are opened.

name: 'Lock down repository'

on:
  issues:
    types: opened
  pull_request:
    types: opened
  schedule:
    - cron: '0 * * * *'

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

Scheduled runs are no longer needed once the initial backlog of issues and pull requests has been processed. It's best to edit the workflow after the backlog has been processed and remove the schedule event to avoid unnecessary workflow runs.

on:
  issues:
    types: opened
  pull_request:
    types: opened

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 down repository'

on:
  issues:
    types: opened
  pull_request:
    types: opened
  schedule:
    - cron: '0 * * * *'

jobs:
  lockdown:
    runs-on: ubuntu-latest
    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}
          exclude-issue-created-before: ''
          exclude-issue-labels: ''
          issue-labels: ''
          issue-comment: ''
          skip-closed-issue-comment: false
          close-issue: true
          lock-issue: true
          issue-lock-reason: ''
          exclude-pr-created-before: ''
          exclude-pr-labels: ''
          pr-labels: ''
          pr-comment: ''
          skip-closed-pr-comment: false
          close-pr: true
          lock-pr: true
          pr-lock-reason: ''
          process-only: ''

Excluding issues and pull requests

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

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

This step will close only pull requests, and exclude those with the pinned label applied.

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

Commenting and labeling

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

    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}
          issue-labels: 'off-topic'
          issue-comment: >
            This repository does not accept bug reports,
            see the README for details.
          pr-comment: >
            This repository does not accept pull requests,
            see the README for details.

Reducing notification spam while commenting

Informing the participants of issues and pull requests before locking discussions can help redirect contributors to the right place to continue their work, though it may be useful to avoid posting comments on already closed issues and pull requests to reduce notification spam.

This step will post a comment on open issues and pull requests before closing and locking them, and will avoid commenting on threads that have already been closed before locking them.

    steps:
      - uses: dessant/[email protected]
        with:
          github-token: ${{ github.token }}
          issue-comment: >
            This repository does not accept bug reports,
            see the README for details.
          skip-closed-issue-comment: true
          pr-comment: >
            This repository does not accept pull requests,
            see the README for details.
          skip-closed-pr-comment: true

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) 2019-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].