Clone Sample repository #6
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
name: Clone Sample repository | |
on: | |
workflow_dispatch: | |
inputs: | |
TARGET_REPO: | |
description: 'The repository to clone to' | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
clone-repo: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: btp-automation-scenarios/sample-btptf-setup | |
path: source | |
sparse-checkout: | | |
. | |
.github | |
.devcontainer | |
infra | |
src | |
- uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.event.inputs.TARGET_REPO }} | |
path: target | |
token: ${{ secrets.GH_CLONE_TOKEN }} | |
- shell: bash | |
run: | | |
cp -rf source/* target/ | |
cp -rf source/.devcontainer target/ | |
cp -rf source/.github target/ | |
cp -rf source/.gitignore target/ | |
cd target | |
git config user.name "btp-automation-scenarios" | |
git config user.email "noreply@btpautomation.com" | |
git add . | |
git commit -m "Initial basic setup by GH Action" | |
git push |