From 7f8468d4a325fabce6f9a4c43170e1a27d42955e Mon Sep 17 00:00:00 2001 From: L7NEG Date: Sun, 25 Jan 2026 20:33:56 +0200 Subject: [PATCH] Add autolocker GitHub Actions workflow Introduces a workflow to automatically lock pull requests when they are closed, using the github-script action. This helps prevent further discussion on resolved or closed PRs. --- .github/workflows/autolocker.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/autolocker.yml diff --git a/.github/workflows/autolocker.yml b/.github/workflows/autolocker.yml new file mode 100644 index 0000000..24c84b8 --- /dev/null +++ b/.github/workflows/autolocker.yml @@ -0,0 +1,24 @@ +name: Autolocker + +on: + pull_request_target: + types: [closed] + +permissions: write-all + +jobs: + autolock: +# if: ${{ github.event.pull_request.merged }} # Uncomment if you want it to run only when a PR gets MERGED + runs-on: ubuntu-latest + name: Autolocker + steps: + - name: Autolock PRs that got merged or closed + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.lock({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + lock_reason: "resolved" // ["off-topic", "too heated", "resolved", "spam"] + })