Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andrewthetechie/gha-repo-manager

Manage your Github repo(s) settings and secrets using Github Actions and a yaml file
https://github.com/andrewthetechie/gha-repo-manager

github-actions python

Last synced: about 1 month ago
JSON representation

Manage your Github repo(s) settings and secrets using Github Actions and a yaml file

Awesome Lists containing this project

README

        

# Repo Manager via Github Actions

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)

## Description

Manage your Github repo(s) settings and secrets using Github Actions and a yaml file

## Usage

This action manages your repo from a yaml file. You can manage:

* branch protection
* labels
* repos
* secrets
* repo settings
* Files

See [examples/settings.yml](./examples/settings.yml) for an example config file. The schemas for this file are in [repo_manager.schemas](./repo_magager/schemas).

### File Management -- Experimental

File management can copy files from your local environment to a target repo, copy files from one location to another in the target repo, move files in the target repo, and delete files in the target repo.

File operations are performed using the Github BLOB API and your PAT. Each file operation is a separate commit.

This feature is helpful to keep workflows or settings file in sync from a central repo to many repos.

### Example workflow

```yaml
name: Run Repo Manager
on: [workflow_dispatch]
jobs:
repo-manager:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Run RepoManager
uses: andrewthetechie/gha-repo-manager@main
with:
# Apply your settings to the repo, can also be check to just check repo settings vs your file or validate, to validate your
# file is valid
action: apply
settings_file: .github/settings.yml
# need a PAT that can edit repo settings
token: ${{ secrets.GITHUB_PAT }}

```

## Inputs

| parameter | description | required | default |
| - | - | - | - |
| action | What action to take with this action. One of validate, check, or apply. Validate will validate your settings file, but not touch your repo. Check will check your repo with your settings file and output a report of any drift. Apply will apply the settings in your settings file to your repo | `false` | check |
| settings_file | What yaml file to use as your settings. This is local to runner running this action. | `false` | .github/settings.yml |
| repo | What repo to perform this action on. Default is self, as in the repo this action is running in | `false` | self |
| github_server_url | Set a custom github server url for github api operations. Useful if you're running on GHE. Will try to autodiscover from env.GITHUB_SERVER_URL if left at default | `false` | none |
| token | What github token to use with this action. | `true` | |

## Outputs

| parameter | description |
| - | - |
| result | Result of the action |
| diff | Diff of this action, dumped to a json string |

## Runs

This action is a `docker` action.

## Contributors

Please see our [Contribution Guide](./CONTRIBUTING.md) for more info on how you can contribute. All contributors and participants in this repo must follow our [Code of Conduct](./CODE_OF_CONDUCT.md).



Andrew
Andrew

🤔 ⚠️ 💻
shiro
shiro

🐛 💻