Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/autoblockprs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Auto-Close PRs by Specific Authors

on:
pull_request_target:
types: [opened]

jobs:
check-author:
runs-on: ubuntu-latest
# Ensure the workflow has permissions to write comments and close PRs
permissions:
pull-requests: write

steps:
- name: Check PR Author and Close if Matched
uses: actions/github-script@v7
with:
script: |
// Define the list of usernames you want to block
const blockedAuthors = ['GabiNun2'];

// Get the author of the current pull request
const prAuthor = context.payload.pull_request.user.login;
const prNumber = context.payload.pull_request.number;

if (blockedAuthors.includes(prAuthor)) {
console.log(`Matching author found: ${prAuthor}. Proceeding to close PR #${prNumber}.`);

// 1. Post a comment explaining why the PR is being closed
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: `ERROR: You have been banned from contributing to this repo.`
});

// 2. Close the pull request
await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
state: 'closed'
});
} else {
console.log(`Author ${prAuthor} is allowed.`);
}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ This is, currently, in **BETA** stages and contains bugs. We are working hard on

**HUGE DISCLAIMER: ONLY USE THIS PROJECT IF YOU KNOW WHAT YOU'RE DOING!!! IF YOU EITHER DON'T KNOW WHAT YOU'RE DOING, OR YOU DON'T KNOW WINDOWS SYSTEMS MANAGEMENT, DO NOT USE THIS SOFTWARE.** Grab [DISMTools](https://github.com/CodingWonders/DISMTools) if you want to learn systems management. Please.

``` ps1
powershell -ExecutionPolicy Bypass -Command "iwr -useb https://raw.githubusercontent.com/CodingWonders/MicroWin/refs/heads/main/Microwin.ps1 | iex"
```

Alternatively you can run the exe manually:

1. Download the latest release
2. Extract it
3. Run the tool as an administrator

> [!NOTE]
> The application is not signed with code-signing certificates because of how expensive these are. Please turn off your antivirus or add an exclusion. We don't want any issue reports of that topic.

Alternatively you can run the following command:
``` ps1
powershell -ExecutionPolicy Bypass -Command "iwr -useb https://raw.githubusercontent.com/CodingWonders/MicroWin/refs/heads/main/Microwin.ps1 | iex"
```

## Contributing to the repository

**Requirements:**
Expand Down
Loading