-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5751dd1
Showing
24 changed files
with
31,205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.licenses/** -diff linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- **I'm submitting a ...** | ||
[ ] spammer report | ||
[ ] bug report | ||
[ ] feature request | ||
[ ] question about the decisions made in the repository | ||
[ ] question about how to use this project | ||
|
||
<!-- IF YOU CHECKED 'SPAMMER REPORT' --> | ||
<!-- UNCOMMENT THIS CODE | ||
#### **Spammer's GitHub username**: | ||
``` | ||
username | ||
``` | ||
#### **Proof of spam (link to PR, screenshot)**: | ||
- [Proof pull request](LINK_TO_PR) | ||
_Paste image in your clipboard here if you have one_ | ||
--> | ||
|
||
|
||
- **Summary** | ||
|
||
- **Other information** (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) | ||
|
||
- **What is the current behavior?** (You can also link to an open issue here) | ||
|
||
- **What is the new behavior (if this is a feature change)?** | ||
|
||
- **Other information**: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This is a basic test workflow that demonstrates how Spamtoberfest works | ||
|
||
name: Pull Request Spamtoberfest checker | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the main branch | ||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "triage" | ||
triage: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Runs a single command using the runners shell | ||
- name: Spamtoberfest | ||
uses: maximelafarie/spamtoberfest@v1 | ||
with: | ||
# Type of action to do if spammer is in the blacklist. Possible values: flag | close | ||
action-type: close # default is flag | ||
# The GITHUB_TOKEN secret | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
node_modules/ | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sources: | ||
npm: true | ||
|
||
allowed: | ||
- apache-2.0 | ||
- bsd-2-clause | ||
- bsd-3-clause | ||
- isc | ||
- mit | ||
- cc0-1.0 | ||
- unlicense | ||
|
||
reviewed: | ||
npm: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Contributing Guidelines | ||
|
||
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. | ||
|
||
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open-source license](../LICENSE). | ||
|
||
## Submitting a Pull Request | ||
|
||
1. [Fork](https://github.com/maximelafarie/spamtoberfest/fork) and clone the repository | ||
1. Configure and install the dependencies: `npm install` | ||
1. Create a new branch: `git checkout -b my-branch-name` | ||
1. Make your change and build the action using `npm run build` | ||
1. Push to your fork and [submit a pull request](https://github.com/maximelafarie/spamtoberfest/compare) | ||
1. Pat your self on the back and wait for your pull request to be reviewed and merged. | ||
|
||
Here are a few things you can do that will increase the likelihood of your pull request being accepted: | ||
|
||
- Follow the coding style used in this project. You can do this by running `npm run format`. | ||
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. | ||
- Write [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). | ||
|
||
## Resources | ||
|
||
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) | ||
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) | ||
- [GitHub Help](https://help.github.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Maxime Lafarie | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
 | ||
|
||
# Spamtoberfest ☠️ | ||
|
||
## What is it | ||
This project was created in order to fight against spammers who are rotting what Hacktoberfest was created for. | ||
|
||
This project consists of two parts: | ||
- One part to list users who spam | ||
- A part to provide those who wish to do so with a GitHub Action to automatically clean their repositories, based on the list of spammers. | ||
|
||
You can either flag some suspicious PRs or directly close and flag them if the author is recorded into the spammers list (in addition, it will not be taken into account for the Hacktoberfest achievements). | ||
|
||
|
||
## How to add somebody to the spammers list? | ||
1. Open an issue with the dedicated issue template and fill the required fields | ||
2. Somebody will take a look at your issue and will push it or not to the repo's blacklist | ||
|
||
## The philosophy, why no PRs? | ||
Any issue doesn't open a PR. We only direct-push to the repo to not "cheat" over the Hacktoberfest event. | ||
|
||
**I would like to avoid that contributing to the list to preserve our projects and our time becomes a PR race.** | ||
|
||
## And so what? | ||
We hope this list, when completed with some spammers that doesn't care that much about the wonderful open source world, will help some maintainers to waiste less time closing useless PRs opened by idiots that just want a t-shirt without carrying about what they contribute. | ||
|
||
## Add the Spamtoberfest Action to your repository | ||
In order to use the Action, you need to add a `workflow` to your project. | ||
|
||
### Create Workflow | ||
Create a workflow (eg: `.github/workflows/spamtoberfest.yml` see [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)) to utilize the spamtoberfest action with content: | ||
|
||
```yml | ||
name: Pull Request Spamtoberfest checker | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
triage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Spamtoberfest | ||
uses: maximelafarie/spamtoberfest@main | ||
with: | ||
action-type: close # default is flag | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
You also can take a look at our [workflow demo file](.github/workflows/main.yml). | ||
_Note: This grants access to the `GITHUB_TOKEN` so the action can make calls to GitHub's rest API_ | ||
|
||
#### Inputs | ||
|
||
Various inputs are defined in [`action.yml`](action.yml) to let you configure Spamtoberfest: | ||
|
||
| Name | Description | Default | | ||
| - | - | - | | ||
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret | N/A | | ||
| `action-type` | The action to be taken in case of a positive test. Possible values are `flag` (adds a "Spam" label to the PR) and `close` (adds a "Spam" label to the PR and closes it). | `flag` | ||
|
||
## Contributing | ||
You want to make the script even faster, the model more sexy? Any **real** contribution to the repo (**not** on the blacklist) should be made with a PR as you would do for a standard GitHub project. More info on the [CONTRIBUTING.md](CONTRIBUTING.md) file. 😉 | ||
|
||
#### `npm run start:dev` | ||
Starts the application in development using `nodemon` and `ts-node` to do hot reloading. | ||
|
||
#### `npm run build` | ||
Builds the app at `build`, cleaning the folder first. | ||
|
||
#### `npm run start` | ||
Starts the app in production by first building the project with `npm run build`, and then executing the compiled JavaScript at `build/index.js`. | ||
|
||
## Screenshots | ||
#### Automatic labelling | ||
<div> | ||
<img width="49%" src="assets/action-label-added.png" /> | ||
<img width="49%" src="assets/spam-closed.png" /> | ||
</div> | ||
|
||
#### Automatic closing | ||
<div> | ||
<img width="49%" src="assets/action-pr-closed.png" /> | ||
<img width="49%" src="assets/spam-closed.png" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
describe("TODO - Add a test suite", () => { | ||
it("TODO - Add a test", async () => {}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Spamtoberfest | Pull request spam checker' | ||
description: 'List, flag and close pull requests from spammers' | ||
author: 'Maxime Lafarie' | ||
branding: | ||
icon: 'user-x' | ||
color: 'gray-dark' | ||
categories: ['Spam', 'Hacktoberfest', 'PR checker', 'checker', 'Pull request'] | ||
|
||
on: [pull_request] | ||
|
||
inputs: | ||
action-type: | ||
description: 'Type of action to do if spammer is in the blacklist. Possible values: flag | close' | ||
default: 'flag' | ||
repo-token: | ||
description: 'The GITHUB_TOKEN secret' | ||
|
||
runs: | ||
using: 'node12' | ||
main: 'dist/index.js' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.