- Create a branch on a remote repository.
- actions/checkout determins the active repo.
jobs:
create-branch-action:
name: Create branch
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Create branch
uses: JosiahSiegel/remote-branch-action@v1.1.0
with:
branch: new-branch
jobs:
create-branch-action:
name: Create branch
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout alt repo
uses: actions/checkout@v4
with:
sparse-checkout: .
repository: me/alt-repo
token: ${{ secrets.ALT_REPO_TOKEN }}
path: alt-repo
- name: Create branch on alt repo
uses: JosiahSiegel/remote-branch-action@v1.1.0
with:
branch: new-branch-alt-repo
path: alt-repo
jobs:
create-branch-action:
name: Create branch
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout second repo
uses: actions/checkout@v4
with:
sparse-checkout: .
repository: me/second-repo
token: ${{ secrets.SECONDARY_REPO_TOKEN }}
path: second-repo
- name: Create branch
id: create-branch-action
uses: JosiahSiegel/remote-branch-action@v1.1.0
with:
branch: new-branch
- name: Create branch on second repo
id: create-branch-action-second-repo
uses: JosiahSiegel/remote-branch-action@v1.1.0
with:
branch: new-branch-second-repo
path: second-repo
- name: Get create branch status
run: echo ${{ steps.create-branch-action.outputs.create-status }}
- name: Get create branch status on second repo
run: echo ${{ steps.create-branch-action-second-repo.outputs.create-status }}
inputs:
branch:
description: Branch name
required: true
path:
description: Relative path under $GITHUB_WORKSPACE to place the repository
required: false
default: '.'
outputs:
create-status:
description: Branch creation status
value: ${{ steps.create-branch.outputs.create_status }}