Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicklegan/github-repo-self-approve-action
A GitHub Action to automatically approve your own pull request for a protected branch using a GitHub App.
https://github.com/nicklegan/github-repo-self-approve-action
actions code-review pull-requests
Last synced: 2 months ago
JSON representation
A GitHub Action to automatically approve your own pull request for a protected branch using a GitHub App.
- Host: GitHub
- URL: https://github.com/nicklegan/github-repo-self-approve-action
- Owner: nicklegan
- License: mit
- Created: 2022-06-03T11:38:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-01T01:02:19.000Z (almost 2 years ago)
- Last Synced: 2024-03-15T14:07:44.781Z (10 months ago)
- Topics: actions, code-review, pull-requests
- Language: JavaScript
- Homepage:
- Size: 176 KB
- Stars: 6
- Watchers: 0
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
- License: LICENSE
- Code of conduct: .github/code_of_conduct.md
- Codeowners: .github/CODEOWNERS
- Security: .github/security.md
Awesome Lists containing this project
README
# GitHub Repository Self-Approve Action
> A GitHub Action to automatically approve your own pull request for a protected branch using a GitHub App.
## Usage
```yaml
name: Self-Approve Actionon:
pull_request:jobs:
self-approve-action:
runs-on: ubuntu-lateststeps:
- name: Checkout
uses: actions/checkout@v3- name: Self-Approve Action
uses: nicklegan/[email protected]
if: github.actor == 'your-username'
with:
appid: ${{ secrets.APPID }}
privatekey: ${{ secrets.PRIVATEKEY }}
installationid: ${{ secrets.INSTALLATIONID }}
```## GitHub App
[Register](https://docs.github.com/developers/apps/building-github-apps/creating-a-github-app) a new organization or personal owned GitHub App with the below permissions:
| GitHub App Permission | Access |
| :------------------------------------- | :------------- |
| `Repository Permissions:Contents` | read and write |
| `Repository Permissions:Pull requests` | read and write |After registration install the GitHub App to your organization. Store the below App values as secrets.
## GitHub secrets
| Name | Value | Required |
| :--------------- | :-------------------------------- | :------- |
| `APPID` | GitHub App ID number | `true` |
| `PRIVATEKEY` | Content of private key .pem file | `true` |
| `INSTALLATIONID` | GitHub App installation ID number | `true` |Finally set your GitHub username as the `github.actor` conditional value within the workflow file.
:bulb: The GitHub App name will be used as the name for the approving reviewer.
## Action inputs
| Name | Description | Default | Options | Required |
| :------------- | :-------------------------------------------------- | :------ | :------------- | :------- |
| `github.actor` | Approve pull requests created by the user specified | | [workflow.yml] | `false` |[workflow.yml]: #Usage 'Usage'