{"id":13495887,"url":"https://github.com/dessant/repo-lockdown","last_synced_at":"2025-04-04T10:09:47.478Z","repository":{"id":41440432,"uuid":"166223026","full_name":"dessant/repo-lockdown","owner":"dessant","description":"GitHub Action that immediately closes and locks issues and pull requests","archived":false,"fork":false,"pushed_at":"2023-11-20T05:04:19.000Z","size":993,"stargazers_count":132,"open_issues_count":1,"forks_count":15,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-02T03:00:25.257Z","etag":null,"topics":["close","fork","github-actions","issues","lock","mirror","pull-requests"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/repo-lockdown","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dessant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"dessant","patreon":"dessant","custom":["https://armin.dev/go/paypal","https://armin.dev/go/bitcoin"]}},"created_at":"2019-01-17T12:35:04.000Z","updated_at":"2024-04-12T19:55:40.000Z","dependencies_parsed_at":"2024-01-16T09:53:36.981Z","dependency_job_id":"18201073-60bc-4600-b059-2a36aceb2df5","html_url":"https://github.com/dessant/repo-lockdown","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":"0.34042553191489366","last_synced_commit":"ebc644bfdc0648ddd11c0fbc1b66650144872f64"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Frepo-lockdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Frepo-lockdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Frepo-lockdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Frepo-lockdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dessant","download_url":"https://codeload.github.com/dessant/repo-lockdown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939190,"owners_count":20857916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["close","fork","github-actions","issues","lock","mirror","pull-requests"],"created_at":"2024-07-31T19:01:39.272Z","updated_at":"2025-04-04T10:09:47.453Z","avatar_url":"https://github.com/dessant.png","language":"JavaScript","funding_links":["https://github.com/sponsors/dessant","https://patreon.com/dessant","https://armin.dev/go/paypal","https://armin.dev/go/bitcoin"],"categories":["JavaScript"],"sub_categories":[],"readme":"# Repo Lockdown\n\nRepo Lockdown is a GitHub Action that immediately closes and locks\nissues and pull requests. It is mainly used with repositories\nthat do not accept issues or pull requests, such as forks and mirrors.\n\n![](assets/screenshot.png)\n\n## Supporting the Project\n\nThe continued development of Repo Lockdown is made possible\nthanks to the support of awesome backers. If you'd like to join them,\nplease consider contributing with\n[Patreon](https://armin.dev/go/patreon?pr=repo-lockdown\u0026src=repo),\n[PayPal](https://armin.dev/go/paypal?pr=repo-lockdown\u0026src=repo) or\n[Bitcoin](https://armin.dev/go/bitcoin?pr=repo-lockdown\u0026src=repo).\n\n## Usage\n\nCreate the `repo-lockdown.yml` workflow file in the `.github/workflows`\ndirectory, use one of the [example workflows](#examples) to get started.\n\n### Inputs\n\nThe action can be configured using [input parameters](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith).\n\n\u003c!-- prettier-ignore --\u003e\n- **`github-token`**\n  - GitHub access token, value must be `${{ github.token }}` or an encrypted\n    secret that contains a [personal access token](#using-a-personal-access-token)\n  - Optional, defaults to `${{ github.token }}`\n- **`exclude-issue-created-before`**\n  - Do not process issues created before a given timestamp,\n    value must follow ISO 8601\n  - Optional, defaults to `''`\n- **`exclude-issue-labels`**\n  - Do not process issues with any of these labels, value must be\n    a comma separated list of labels\n  - Optional, defaults to `''`\n- **`issue-labels`**\n  - Labels to add before closing or locking an issue, value must be\n    a comma separated list of labels\n  - Optional, defaults to `''`\n- **`issue-comment`**\n  - Comment to post before closing or locking an issue\n  - Optional, defaults to `''`\n- **`skip-closed-issue-comment`**\n  - Do not comment on already closed issues before locking,\n    value must be either `true` or `false`\n  - Optional, defaults to `false`\n- **`close-issue`**\n  - Close issues, value must be either `true` or `false`\n  - Optional, defaults to `true`\n- **`issue-close-reason`**\n  - Reason for closing an issue, value must be\n    either `completed` or `not planned`\n  - Optional, defaults to `not planned`\n- **`lock-issue`**\n  - Lock issues, value must be either `true` or `false`\n  - Optional, defaults to `true`\n- **`issue-lock-reason`**\n  - Reason for locking an issue, value must be one\n    of `resolved`, `off-topic`, `too heated` or `spam`\n  - Optional, defaults to `''`\n- **`exclude-pr-created-before`**\n  - Do not process pull requests created before a given timestamp,\n    value must follow ISO 8601\n  - Optional, defaults to `''`\n- **`exclude-pr-labels`**\n  - Do not process pull requests with any of these labels, value must be\n    a comma separated list of labels\n  - Optional, defaults to `''`\n- **`pr-labels`**\n  - Labels to add before closing or locking a pull request, value must be\n    a comma separated list of labels\n  - Optional, defaults to `''`\n- **`pr-comment`**\n  - Comment to post before closing or locking a pull request\n  - Optional, defaults to `''`\n- **`skip-closed-pr-comment`**\n  - Do not comment on already closed pull requests before locking,\n    value must be either `true` or `false`\n  - Optional, defaults to `false`\n- **`close-pr`**\n  - Close pull requests, value must be either `true` or `false`\n  - Optional, defaults to `true`\n- **`lock-pr`**\n  - Lock pull requests, value must be either `true` or `false`\n  - Optional, defaults to `true`\n- **`pr-lock-reason`**\n  - Reason for locking a pull request, value must be one\n    of `resolved`, `off-topic`, `too heated` or `spam`\n  - Optional, defaults to `''`\n- **`process-only`**\n  - Process only issues or pull requests, value must be\n    either `issues` or `prs`\n  - Optional, defaults to `''`\n- **`log-output`**\n  - Log output parameters, value must be either `true` or `false`\n  - Optional, defaults to `false`\n\n### Outputs\n\n\u003c!-- prettier-ignore --\u003e\n- **`issues`**\n  - Issues that have been closed or locked, value is a JSON string in\n    the form of `[{\"owner\": \"actions\", \"repo\": \"toolkit\", \"issue_number\": 1}]`\n  - Defaults to `''`\n- **`prs`**\n  - Pull requests that have been closed or locked, value is a JSON string in\n    the form of `[{\"owner\": \"actions\", \"repo\": \"toolkit\", \"issue_number\": 1}]`\n  - Defaults to `''`\n\n## Examples\n\nThe following workflow will search once an hour for existing issues\nand pull requests that can be closed or locked. New issues and pull requests\nwill be immediately processed when they are opened.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\nname: 'Repo Lockdown'\n\non:\n  issues:\n    types: opened\n  pull_request_target:\n    types: opened\n  schedule:\n    - cron: '0 * * * *'\n\npermissions:\n  issues: write\n  pull-requests: write\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/repo-lockdown@v4\n```\n\nScheduled runs are no longer needed once the initial backlog\nof issues and pull requests has been processed. It's best to edit\nthe workflow after the backlog has been processed and remove\nthe `schedule` event to avoid unnecessary workflow runs.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\non:\n  issues:\n    types: opened\n  pull_request_target:\n    types: opened\n```\n\n### Available input parameters\n\nThis workflow declares all the available input parameters of the action\nand their default values. Any of the parameters can be omitted.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\nname: 'Repo Lockdown'\n\non:\n  issues:\n    types: opened\n  pull_request_target:\n    types: opened\n  schedule:\n    - cron: '0 * * * *'\n\npermissions:\n  issues: write\n  pull-requests: write\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/repo-lockdown@v4\n        with:\n          github-token: ${{ github.token }}\n          exclude-issue-created-before: ''\n          exclude-issue-labels: ''\n          issue-labels: ''\n          issue-comment: ''\n          skip-closed-issue-comment: false\n          close-issue: true\n          issue-close-reason: 'not planned'\n          lock-issue: true\n          issue-lock-reason: ''\n          exclude-pr-created-before: ''\n          exclude-pr-labels: ''\n          pr-labels: ''\n          pr-comment: ''\n          skip-closed-pr-comment: false\n          close-pr: true\n          lock-pr: true\n          pr-lock-reason: ''\n          process-only: ''\n          log-output: false\n```\n\n### Excluding issues and pull requests\n\nThis step will close and lock only issues, and exclude issues created\nbefore 2018, or those with the `pinned` or `help-wanted` labels applied.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/repo-lockdown@v4\n        with:\n          exclude-issue-created-before: '2018-01-01T00:00:00Z'\n          exclude-issue-labels: 'pinned, help-wanted'\n          process-only: 'issues'\n```\n\nThis step will close only pull requests, and exclude those\nwith the `pinned` label applied.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/repo-lockdown@v4\n        with:\n          exclude-pr-labels: 'pinned'\n          lock-pr: false\n          process-only: 'prs'\n```\n\n### Commenting and labeling\n\nThis step will post a comment on issues and pull requests before\nclosing and locking them, and will apply the `off-topic` label to issues.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/repo-lockdown@v4\n        with:\n          issue-labels: 'off-topic'\n          issue-comment: \u003e\n            This repository does not accept bug reports,\n            see the README for details.\n          pr-comment: \u003e\n            This repository does not accept pull requests,\n            see the README for details.\n```\n\n### Reducing notification spam while commenting\n\nInforming the participants of issues and pull requests before locking\ndiscussions can help redirect contributors to the right place\nto continue their work, though it may be useful to avoid posting comments\non already closed issues and pull requests to reduce notification spam.\n\nThis step will post a comment on open issues and pull requests before\nclosing and locking them, and will avoid commenting on threads\nthat have already been closed before locking them.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/repo-lockdown@v4\n        with:\n          issue-comment: \u003e\n            This repository does not accept bug reports,\n            see the README for details.\n          skip-closed-issue-comment: true\n          pr-comment: \u003e\n            This repository does not accept pull requests,\n            see the README for details.\n          skip-closed-pr-comment: true\n```\n\n### Using a personal access token\n\nThe action uses an installation access token by default to interact with GitHub.\nYou may also authenticate with a personal access token to perform actions\nas a GitHub user instead of the `github-actions` app.\n\nCreate a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)\nwith the `repo` or `public_repo` scopes enabled, and add the token as an\n[encrypted secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository)\nfor the repository or organization, then provide the action with the secret\nusing the `github-token` input parameter.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/repo-lockdown@v4\n        with:\n          github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}\n```\n\n## Why are only some issues and pull requests processed?\n\nTo avoid triggering abuse prevention mechanisms on GitHub, only 50 threads\nwill be handled at a time. If your repository has more than that,\nit will take a few hours or days to process them all.\n\n## License\n\nCopyright (c) 2019-2023 Armin Sebastian\n\nThis software is released under the terms of the MIT License.\nSee the [LICENSE](LICENSE) file for further information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdessant%2Frepo-lockdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdessant%2Frepo-lockdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdessant%2Frepo-lockdown/lists"}