8000 GitHub - csm-actions/approve-pr-action: GitHub Action to approve pull requests securely
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

csm-actions/approve-pr-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Approve PR Action

License | Versioning Policy

Approve PR Action is a set of GitHub Actions to approve pull requests securely by the Client/Server Model.

Approve PR Action allows you to approve pull requests by Machine Users securely without sharing Machine Users' Personal Access Tokens (PAT) across GitHub Actions workflows. It elevates the security of your workflows to the next level.

Features

  • 💪 Approve pull requests to merge pull requests automatically
  • 🛡 Secure
    • You don't need to pass PAT of machine users to GitHub Actions workflows on the client side
  • 😊 Easy to use
    • You don't need to host a server application
  • 😉 OSS (MIT License)

Overview

It would be convenient to automatically merge pull requests created by apps like Renovate. Manually reviewing and merging all of them can be time-consuming and labor-intensive. Tedious reviews can sometimes become mere formalities. This can lead to delayed updates and potentially troublesome issues.

Of course, automatic merging comes with its own risks, but if the benefits of automation outweigh those risks, it’s a good idea to automatically merge at least some updates—excluding major updates, for example.

But if approvals from codeowners are required by Branch Rulesets, you need to approve pull requests automatically. GitHub Apps can't be codeowners, so you need to approve pull requests using machine user's PAT. But if the PAT is abused, people can approve any pull requests using it and merge them without pull request reviews. It's so dangerous. So you must protect machine user's PAT securely. You shouldn't pass it to workflows widely.

This action allows you to protect PAT by the Client/Server Model.

This action intends to approve only pull requests created by reliable Apps automatically. This action doesn't approve pull requests unless they don't meet the following conditions:

  1. All commits are linked to GitHub Users
  2. All commits are signed
  3. All committers or authors are allowed in the input allowed_committers (By default, allowed_committers are renovate[bot] and dependabot[bot])

How To Set Up

  • Create a server repository
  • Create a server GitHub App:
    • Required Permissions: pull_requests:read and contents:read To validate pull requests
    • Installed Repositories: client and server repositories
  • Create a fine-grained PAT of a machine user
    • Required Permissions:
      • pull_requests:write: To approve pull requests
    • Repositories: client repositories
  • Allow the server workflow to access the PAT securely
  • Create the server workflow: Example
  • Create a client GitHub App:
    • Required Permissions: issues:write To create GitHub Issue labels
    • Installed Repositories: client and server repositories
  • Run the client action in client workflows: Example

Actions

Approve PR Action composes of following actions:

About

GitHub Action to approve pull requests securely

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •  
0