Skip to content

BisonTransport/git-subtree-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-subtree

This is a GitHub Action to make use of git subtree commands. It works around GitHub Action magic to enable adding and pulling subtrees from other repositories.

How to use it

  1. Create a Personal Access Token (PAT).
  2. Add your PAT to your repos actions secrets.
    • Find it at Your Repo > Settings > Secrets and variables > Actions OR modify this URL accordingly and open it: https://github.com/{user-or-org}/{repo}/settings/secrets/actions
    • This doc uses PAT as a name
  3. Add this action to your workflow
# .github/workflows/update.yml

name: "update subtree"
on:
  push:
  workflow_dispatch:

jobs:
  update-lib:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: bisontransport/git-subtree-action@v1
        with:
          pat: ${{ secrets.PAT }}
          repo: https://github.com/{user}/{repo}.git
          action: pull
          prefix: my-dir
          message: Custom Commit Message
      - name: push
        run: git push

Parameters

Input Description Required Default
pat GitHub Persoanl Access Token true
git_name Git User Name GitHub Actions
git_email Git User Email actions@github.com
repo Repository to add/pull (only https path supported) true
action Action (add/ pull) true
position Branch Name or Commit Sha main
position_fallback Branch Name of Commit Sha master
prefix Path to put subtree in repo true
squash Should the subtree merge be sqashed true
message Message (depending on command) Subtree Action

About

Run git subtree commands in GitHub Actions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 80.0%
  • Dockerfile 20.0%