diff --git a/.github/workflows/autoblockprs.yml b/.github/workflows/autoblockprs.yml new file mode 100644 index 0000000..31908e9 --- /dev/null +++ b/.github/workflows/autoblockprs.yml @@ -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.`); + } diff --git a/README.md b/README.md index 8a110e3..bffe099 100755 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ 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 @@ -20,11 +26,6 @@ This is, currently, in **BETA** stages and contains bugs. We are working hard on > [!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:**