Skip to content

Commit

Permalink
Setup action (#6)
Browse files Browse the repository at this point in the history
* Update: Add definition for GitHub Action

* Update: readme
  • Loading branch information
till committed Jun 28, 2020
1 parent 4b72c42 commit fb8552b
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 7 deletions.
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,51 @@

# github-org-sync(-action)

`github-org-sync` is a little tool to sync files from a skeleton/template repository to other repositories in your organization. It works within a single organization, but of course it can be used multiple times.
`github-org-sync(-action)` is a tool to sync files from a skeleton/template repository to other repositories in your organization. It works within a single organization, but of course it can be used multiple times.

It currently syncs `.github/workflows` — more is planned.

Inspiration from:
- https://github.com/cloudalchemy/auto-maintenance
- https://github.com/prometheus/prometheus/blob/master/scripts/sync_repo_files.sh

### Status
## GitHub Action

### Inputs

#### `github-user`

**Required** Name of the user to commit files and open PRs.

#### `github-email`

**Required** Email of the user to commit files and open PRs.

#### `github-access-token`

**Required** An access token (used for clone and push), scope repo.

#### `github-org`

**Required** Your Github organization. Default: `hostwithquantum`

#### `github-skeleton`

**Required** The base repository to sync files from. Default: `ansible-skeleton`.

#### `github-repos`

**Required** A (space-delimited) list of repositories to sync to. Default: `"ansible-weave"`

We currently provide a tool (written in Golang) to do the syncing. We sync files from `.github/workflows` only, more files/directories are planned and will be added when time permits.
## Standalone

The goal is to offer a GitHub Action as well.
If GitHub Actions are not applicable to your environment, you may run the tool without (and e.g. via `cron.d`).

## Getting it
### Getting it

All releases are done using the amazing `goreleaser` in a release workflow in this repository. The workflow validates and builds binaries for different OS' and architectures and a Docker image (amd64) as well.

### Installing
#### Installing

You may download a release for Mac, Linux or Windows here:
- https://github.com/hostwithquantum/github-org-sync-action/releases
Expand All @@ -28,7 +56,7 @@ To use the Docker image, please follow this link:

Otherwise: `make dev` to build a snapshot.

### Configuration
#### Configuration

- `github-org-sync` uses environment variables. There is nothing else currently.
- See [.envrc-dist](.envrc-dist) for necessary configuration.
Expand Down
35 changes: 35 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'GitHub Organization Sync(er)'
description: 'A GitHub Action to sync files across repositories'
inputs:
github-user:
description: Name of the user to commit files and open PRs.
required: true
github-email:
description: Email of the user to commit files and open PRs.
required: true
github-access-token:
description: An access token (used for clone and push), scope repo.
required: true
github-org:
description: Your Github organization.
required: true
default: hostwithquantum
github-skeleton:
description: The base repository to sync files from.
required: true
default: ansible-skeleton
github-repos:
description: A (space-delimited) list of repositories to sync to.
required: true
default: "ansible-weave"

runs:
using: 'docker'
image: 'docker://docker.pkg.github.com/hostwithquantum/github-org-sync-action/github-org-sync:latest'
env:
GITHUB_USER: ${{ inputs.github-user }}
GITHUB_EMAIL: ${{ inputs.github-email }}
GITHUB_ACCESS_TOKEN: ${{ inputs.github-access-token }}
GITHUB_ORG: ${{ inputs.github-org }}
GITHUB_SKELETON: ${{ inputs.github-skeleton }}
GITHUB_REPOS: ${{ inputs.github-repos }}

0 comments on commit fb8552b

Please sign in to comment.