Giter VIP home page Giter VIP logo

rummelsnuff's Introduction

Rummelsnuff

A GitHub action to mark and close spam PRs created to get a free HacktoberFest T-shirt.

Rules

A pull request is considered as spam if it's coming from a forked repository and meets at least one of following criterias:

  • The author has registered after this year's Hacktoberfest and has only forked repositories
  • The PR is changing documentation insignificantly
  • The PR consists of additions or deletions in a single file only

Configuration

The action needs an access token to manage PRs. To provide an access token, add access_token: ${{ secrets.GITHUB_TOKEN }} to the with: section of your workflow step (see example below).

By default this action adds "Spam" label and closes the PR that is recognized as spam. A custom label can be provided via the spam_label input. To disable closing PRs set the close_spam_prs to any value except "yes", for example:

- name: Rummelsnuff
  uses: andrewslotin/rummelsnuff@master
    with:
      spam_label: "Bad PR" # default: "Spam"
      close_spam_prs: "no" # default: "yes"
      access_token: ${{ secrets.GITHUB_TOKEN }} # one-time access token generated for this action run

rummelsnuff's People

Contributors

andrewslotin avatar maggiefero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rummelsnuff's Issues

panic: runtime error

Hi,

I got this error message today:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1a0 pc=0x66d2a7]

goroutine 1 [running]:
main.main()
	/go/github.com/andrewslotin/rummelsnuff/main.go:62 +0x3c7

Here is my config:

on:
  pull_request_target:
    branches: [main]
  push:
    branches: [ "**" ]
  workflow_dispatch:


defaults:
  run:
    shell: bash


jobs:
  cifirewalling:
    runs-on: ubuntu-latest
    steps:
      - name: Anti-PR-spam
        uses: andrewslotin/[email protected]
        with:
          spam_label: "spam"
          close_spam_prs: "yes"
          access_token: ${{ secrets.GITHUB_TOKEN }}

Allow single-file changes from users with contributions in September

Since the idea is to disincentivize spam PRs so that maintainers can focus on PRs that will help end users, and some PRs that only affect a single file are significant (like the one that will resolve this issue), you could reduce false positives by exempting single-file commits from contributors who also have Github contributions in September (before Hacktoberfest started).

The Github GraphQL API has a ContributionCalendarMonth object that could be used for this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.