README
¶
astra
A GitHub Action which helps automate the management of GitHub pull requests for your organization
Features
- Scans repositories in your organization based on a name prefix
- Automatically reruns failed workflows for pull requests
- Enables auto-merge for pull requests
- Supports processing pull requests only opened by certain actors (ex: Dependabot)
Example Usage
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
push:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: champ-oss/astra
with:
dry-run: false
debug: true
owner: myorganization
app-id: 123
installation-id: 123
pem: ${{ secrets.PEM }}
default-branch: main
wait-seconds-between-requests: 2
max-run-attempts: 3
repo-prefixes: |
my-repo
actors: |
dependabot
How to Set Up A GitHub App
A GitHub App is required to use this Action.
Overview: https://docs.github.com/en/developers/apps/building-github-apps/creating-a-github-app
- The name of the app can be whatever makes sense to you
- You can use
https://localhostas the Homepage URL - All other options can be left at the default settings
- After creation, install the GitHub App into your organization
- Make note of the
App IDandInstallation IDwhich must be passed in to this Action - Generate a private key in the app and save the key. The contents of the key should be base64 encoded when passed into this Action. Example:
cat key.pem | base64 -w 0
GitHub App Permissions
These permission settings are required when creating the GitHub App If a permission is not listed below then the default setting (no access) should be used.
- Actions: Read and Write
- Administration: Read-only
- Checks: Read and Write
- Commit statuses: Read-only
- Contents: Read and Write
- Metadata: Read-only
- Pull Requests: Read and Write
- Workflows: Read and Write
Parameters
| Parameter | Required | Description |
|---|---|---|
| owner | true | Name of GitHub organization or owner |
| app-id | true | GitHub App ID |
| installation-id | true | GitHub Installation ID |
| pem | true | GitHub App PEM file |
| repo-prefixes | true | Only repositories containing these prefixes will be processed |
| actors | false | Only pull requests by these actors will be processed |
| dry-run | false | Scan repositories but do not rerun workflows or make any changes |
| debug | false | Enable debug logging |
| default-branch | false | The name of the default branch for your repositories |
| wait-seconds-between-requests | false | Slow down requests against the GitHub API to avoid throttling |
| max-run-attempts | false | A workflow will not be restarted if it has failed this many times |
| expect-required-approving-review-count | false | Expect branch protection to require at least this number of approving reviews |
| expect-requires-status-checks | false | Expect branch protection to require status checks |
| expect-requires-strict-status-checks | false | Expect branch protection to require branches be up to date before merging |
| expect-requires-approving-reviews | false | Expect branch protection to require approving reviews before merging |
| expect-required-status-checks | false | Expect branch protection to require at least this number of passing status checks |
Contributing
Documentation
¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.