Skip to content

Enforce democracy on a project by allowing a community to vote for mergeable pull requests

License

Notifications You must be signed in to change notification settings

deuzu/github-democrat-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation


Logo

Github Democrat Action

Enforce democracy on a project by allowing a community to vote for mergeable pull requests.
Explore the docs »

Report Bug · Request Feature · Send a Pull Request

Table of Contents

About The Project

Have you ever been frustated that your open source contribution never gets merged?
Or that you missed a contribution on one of your project because you were not available?
I have...

Maintainers and contributors schedules are not synchronised. Manage or contribute to open source takes time.
Open source management and contribution are often done on your free time, and you want it as smooth as possible.
Plus, you want the open source community to be as open as it should.

That's when I knew open source community needed democracy!
GNU defines a "free software" so that we can run, study, redistribute and distrubute modified copies.
What if, as an open source enthousiasts, you could vote to express your opinion on a project?

The Github Democrat brings democracy to a project.
It gives contributors and non-contributors another way to participate by voting.
The world is more than ever in the need of strong democracy enthousiasts. And so is the open source community.

Built With

Getting Started

Installation

Create a new workflow in .github/workflows/democracy-enforcer.yaml.

name: 'democracy-enforcer'

on:
  schedule:
    - cron: '*/30 * * * *' # checks pull requests to merge every 30 minutes
  pull_request:
    types:
      - opened # for a voting opening message on a pull request

jobs:
  enforce-democracy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: deuzu/github-democrat-action
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }} # GitHub automatically creates the GITHUB_TOKEN secret
          voters: deuzu, not-deuzu
          # dryRun: true
          # prMinimumReviewScore: 1
          # prVotingTimeHours: 24
          # prMarkAsMegeableLabel: ready
          # prTargetBranch: main

Cf. ./action.yml for action inputs.

The job will look for open pull requests and merge ones that satisfy the following constraints (configurable):

  • receive more than half of the majority vote cast (votes are review approves and request changes)
  • is ready to be merged (with a configurable label)
  • is mature (last commit is older than a configurable delay)
  • target is the configured branch

To avoid fraud, it's advised to add protections on the target branch:

  • Require pull request reviews before merging
  • Dismiss stale pull request approvals when new commits are pushed
  • Require status checks to pass before merging

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are extremely appreciated.
Please read those guidelines before contributing to this repository.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feat-amazing-feature)
  3. Commit your Changes (git commit -m 'feat(scope): Add some AmazingFeature' -m "Closes #42")
  4. Push to the Branch (git push origin feat-amazing-feature)
  5. Open a Pull Request

License

MIT

Contact

Acknowledgements

About

Enforce democracy on a project by allowing a community to vote for mergeable pull requests

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published