Skip to content

Commit

Permalink
Create another.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
kamal-devtron authored Aug 22, 2023
1 parent b290467 commit 68ffc45
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/another.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Create and Push Branch

on:
push:
branches:
- main # Change this to your source branch

jobs:
create-and-push-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v2

- name: Set up Git credentials for source repository
run: |
git config user.name "kamal-devtron"
git config user.email "kamal@devtron.ai"
- name: Create and push branch
run: |
SOURCE_BRANCH_NAME=main # Change this to your source branch
TARGET_BRANCH_NAME=feature/my-new-branch # Change this to the branch you want to create in the target repository
# Create a new branch in the source repository
git checkout -b $TARGET_BRANCH_NAME
git push origin $TARGET_BRANCH_NAME
# Clone the target repository
git clone --depth=1 https://github.com/kamal-devtron/testing.git testing
cd target-repo
# Fetch the new branch from the source repository
git fetch --no-tags origin $TARGET_BRANCH_NAME:$TARGET_BRANCH_NAME
# Push the new branch to the target repository
git push origin $TARGET_BRANCH_NAME

0 comments on commit 68ffc45

Please sign in to comment.