https://github.com/nxtlvlsoftware/git-subtree-action
Keep a git subtree in sync using the actions pipeline.
https://github.com/nxtlvlsoftware/git-subtree-action
Last synced: 5 months ago
JSON representation
Keep a git subtree in sync using the actions pipeline.
- Host: GitHub
- URL: https://github.com/nxtlvlsoftware/git-subtree-action
- Owner: NxtLvLSoftware
- Created: 2020-07-05T02:17:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T02:05:01.000Z (over 2 years ago)
- Last Synced: 2024-12-17T09:21:58.872Z (5 months ago)
- Language: Shell
- Homepage:
- Size: 37.1 KB
- Stars: 16
- Watchers: 2
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-subtree-action
The source for the git-subtree github action.## About
This repository contains the source code for the git-subtree action that allows you to easily keep a git subtree in sync
using the actions pipeline.## Usage
### Action Inputs
| Input | Description |
| ------------ | ------------------------------------------------------------------------------------- |
| repo | Child repository to sync the subtree to (eg. owner/repository.) |
| path | Path prefix in parent repo to split into child subtree (eg. src/PackageName.) |
| deploy_key | Deployment (public) SSH key for pushing to child repo (use deployment tokens for single repos or bot accounts for multi-repos/orgs.)|
| tag | Create (or mirror) a tag on the child subtree repository (branch or tag ref that triggered the workflow when true.) |
| force | Force push to the child subtree repository (recommended for pure downstream mirrors.) |
| branch | Branch of child subtree repository (default is branch or tag ref that triggered the workflow.) |### Workflow Examples
This example uses a matrix to sync a list of namespaces into child subtree repos.```yaml
name: subtree-matrixon: [push]
jobs:
sync-downstream:runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
path:
- command
- database
- supportname: Update downstream ${{ matrix.path }} package
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: nxtlvlsoftware/[email protected]
with:
repo: 'nxtlvlsoftware/${{ matrix.path }}'
path: 'src/${{ matrix.path }}'
deploy_key: ${{ secrets.DOWNSTREAM_GITHUB_DEPLOY_KEY }}
force: true # will force push to the downstream repository
```### Syncing tags
You can also keep tags/releases in sync by using the `tag` input option.```yaml
name: subtree-packageon:
release:
types: [published]jobs:
sync-downstream:runs-on: ubuntu-latest
name: Update downstream repository
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: nxtlvlsoftware/[email protected]
with:
repo: 'nxtlvlsoftware/my-fancy-package'
path: 'packages/fancy-package'
deploy_key: ${{ secrets.DOWNSTREAM_GITHUB_DEPLOY_KEY }}
tag: true # will use the tag name from the event if true is specified
```