Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/octogonapus/filemaintainer
Maintains files in your repositories so you don't have to.
https://github.com/octogonapus/filemaintainer
Last synced: 20 days ago
JSON representation
Maintains files in your repositories so you don't have to.
- Host: GitHub
- URL: https://github.com/octogonapus/filemaintainer
- Owner: Octogonapus
- Created: 2023-06-01T14:58:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-02T15:55:11.000Z (6 months ago)
- Last Synced: 2024-12-15T13:14:01.567Z (24 days ago)
- Language: Go
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FileMaintainer
Maintains files in your repositories so you don't have to.
Supports GitHub.
Supports individual repositories, some/all repositories of a user(s), and some/all repositories of an organization(s).
GitHub Enterprise is not directly supported, just list your organizations instead.Changes are applied to the default branch.
Updates are primarily made via the GitHub API; if this fails, Git will be used instead.Requires a GitHub token in the `GITHUB_TOKEN` environment variable with scopes: `repo`, `workflow`.
## Install
### Binary Installation
Download an appropriate binary from the [latest release](https://github.com/Octogonapus/FileMaintainer/releases/latest).
### Manual Installation
```sh
git clone https://github.com/Octogonapus/FileMaintainer
cd FileMaintainer
go build
go install
```## Usage
Create a `FileMaintainer.toml` file, along with supporting files, like the example below.
Then run `FileMaintainer` in the same directory as `FileMaintainer.toml`.
Review the changes and apply them: `FileMaintainer --dry-run=false`.### Example FileMaintainer.toml
```toml
[remote.entire_org]
owner = "MyOrg" # owner signifies an organization
exclude_repos = ["SomeRepo"] # filter out some repositories by name[remote.some_user]
user = "SomeUsername" # user signifies an individual user[remote.julia_pkgs]
owner = "MyOrg"
repo_glob = "*.jl" # filter by repository name[remote.single_repo]
owner = "MyOrg"
repo = "MyRepo" # select a single repository by name[file.gitleaks]
path = "gitleaks/gitleaks.yml" # a local file in the same directory as this file
dest = ".github/workflows/gitleaks.yml" # the remote file path relative to the repository root
remotes = ["entire_org"][file.juliafmt]
path = "juliafmt/action.yml" # a local file in the same directory as this file
dest = ".github/workflows/formatter.yml" # the remote file path relative to the repository root
remotes = ["julia_pkgs"]
```### Example GitHub Actions Workflow
```yml
name: FileMaintaineron:
workflow_dispatch:jobs:
FileMaintainer:
runs-on: ubuntu-latestenv:
VERSION: 0.1.4steps:
- uses: actions/checkout@v3- name: Install FileMaintainer
run: |
wget -nv "https://github.com/Octogonapus/FileMaintainer/releases/download/v$VERSION/FileMaintainer_${VERSION}_linux_amd64.tar.gz"
tar -xf "FileMaintainer_${VERSION}_linux_amd64.tar.gz"- name: Run FileMaintainer
env:
GITHUB_TOKEN: ${{ secrets.SOME_PAT }}
run: ./FileMaintainer --dry-run=true # FIXME turn off dry runs after you have tested this
```