Skip to content

Commit 0c1258f

Browse files
authored
Merge pull request #26 from code2docs-ai/ups216/improve-create-repo-4
Improve create-repo.yml by using the input parameter branchName to determine which branch to clone
2 parents 73c0185 + 8078271 commit 0c1258f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.github/workflows/create-repo.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
8989
- name: Clone the source from repoUrl
9090
run: |
91-
git clone ${{ github.event.inputs.repoUrl }} ${{ env.repoName }}
91+
git clone --branch ${{ github.event.inputs.branchName }} ${{ github.event.inputs.repoUrl }} ${{ env.repoName }}
9292
cd ${{ env.repoName }}
9393
9494
- name: Run aise-cli
@@ -105,4 +105,3 @@ jobs:
105105
git add .
106106
git commit -m "Generate document for ${{ env.repoName }}"
107107
git push https://code2docs-ai:${{ secrets.MY_PAT }}@github.com/code2docs-ai/${{ env.docs_repo_name }}.git main
108-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To use this GitHub Action workflow, follow these steps:
2121
- If the repository exists, delete it before creating a new one.
2222
- Create a new repository in the current organization with the name `docs_repo_name` using the GitHub API.
2323
- Check if the local directory already exists and remove it if it exists before cloning the repository.
24-
- Clone the source from `repoUrl` at the end of the workflow.
24+
- Clone the source from `repoUrl` at the end of the workflow, using the `branchName` input parameter to specify which branch to clone.
2525
- Clean up the working directory on the runner before running any steps.
2626

2727
### Example

0 commit comments

Comments
 (0)