-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logic for if dest branch doesnt exist
- Loading branch information
github-actions
committed
Oct 24, 2024
1 parent
f1065ac
commit ee26404
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,13 +43,29 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
path: "source" | ||
- name: Checkout destination repo | ||
|
||
- name: Checkout destination repo (Branch exists) | ||
uses: actions/checkout@v4 | ||
if: ${{ steps.check_branch.outputs.branch_exists != 0 }} | ||
with: | ||
path: "destination" | ||
repository: ${{ inputs.repo }} | ||
token: ${{ secrets.PAT }} | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Checkout destination repo (Branch doesn't exist) | ||
uses: actions/checkout@v4 | ||
if: ${{ steps.check_branch.outputs.branch_exists == 0 }} | ||
with: | ||
path: "destination" | ||
repository: ${{ inputs.repo }} | ||
token: ${{ secrets.PAT }} | ||
- name: Create branch in destination repo | ||
if: ${{ steps.check_branch.outputs.branch_exists == 0 }} | ||
run: | | ||
cd destination | ||
git checkout -b ${{ inputs.branch }} | ||
- run: echo ${{inputs.prerun}} | ||
- name: Run pre-run command | ||
if: inputs.prerun != '' | ||
|
@@ -70,9 +86,7 @@ jobs: | |
git config --global user.email "[email protected]" | ||
git add -A | ||
git commit -m "deps(automated): ${{inputs.commit_msg}} ${{ steps.date.outputs.date }}" | ||
git push | ||
# --set-upstream origin ${{steps.branch_name.outputs.BRANCH_NAME}} -f | ||
git push --set-upstream origin ${{inputs.branch}} -f | ||
# - name: Push files if branch exists | ||
# uses: dmnemec/copy_file_to_another_repo_action@main | ||
|