Skip to content

Github action to push code from a source repo to a release repo. Useful when package distribution requires a separate release repository for running its automated actions.

License

Notifications You must be signed in to change notification settings

automatika-robotics/push-to-release-repo-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

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

push-to-release-repo-action

This github action can be used to push code from a source repo to a release repo. Useful when package distribution requires a separate release repository for running its automated actions.

Inputs

destination-username

Description: Username of the destination repository owner. Required: true

destination-access-token

Description: Access token for the destination repository. Should be supplied through source repository secrets. Required: false

destination-repository

Description: Complete destination repository name in the form (username/repo-name). Required: true

git-server

Description: Optional: Git server e.g., github.com or gitlab.com Default: "github.com" Required: false

source-branch

Description: Optional: Source repository branch. Defaults to main. Default: "main" Required: false

target-branch

Description: Optional: Destination (release) repository branch. Defaults to main. Default: "main" Required: false

Example Usage

Example 1: Basic Usage

This example demonstrates a basic usage scenario where you want to push the main branch of your source repository to a destination release repository hosted on github.com.

name: Push to Release Repository

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Source Code
      uses: actions/checkout@v4

    - name: Push to Destination Repository
      uses: automatika-robotics/push-to-release-repo-action@v2
      with:
        destination-username: "destination-user"
        destination-access-token: ${{ secrets.DESTINATION_ACCESS_TOKEN }}
        destination-repository: "destination-user/destination-repo"

Example 2: Pushing a specific source branch to a specific destination branch

This example demonstrates an advanced usage scenario where you want to push a specific branch (release-candidate) from your source repository to a different branch (staging) in the destination release repository hosted on gitlab.com.

name: Push Release Candidate to Staging Repository

on:
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Source Code
      uses: actions/checkout@v4

    - name: Push to Destination Repository
      uses: automatika-robotics/push-to-release-repo-action@v2
      with:
        destination-username: "destination-user"
        destination-access-token: ${{ secrets.DESTINATION_ACCESS_TOKEN }}
        destination-repository: "destination-user/destination-repo"
        git-server: "gitlab.com"
        source-branch: "release-candidate"
        target-branch: "staging"

Example 3: Pushing a specific folder from source

This example assumes that you want to push only the contents of a specific folder (docs/) from your source repository to a target release repository:

name: Push Documentation to Release

on:
  push:
    branches:
      - main

jobs:
  push-to-release:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout Source Repository
      uses: actions/checkout@v4

    - name: Push Documentation to Release
      uses: automatika-robotics/push-to-release-repo-action@v2
      with:
        destination-username: 'destination-username'
        destination-access-token: ${{ secrets.DESTINATION_ACCESS_TOKEN }}
        destination-repository: 'username/release-repo'
        source-folder: './docs/'  # Specifies the folder to push
        commit-email: '[email protected]' # Optional, defaults to destination-username@git-server
        commit-message: 'Push documentation updates to release' # Optional, customizes the commit message

Contributions

All contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue in the repository.

About

Github action to push code from a source repo to a release repo. Useful when package distribution requires a separate release repository for running its automated actions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published