From 3130c7a2bcc2189118f51bfacd60c0974a89f031 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 13 Apr 2023 14:38:24 +0800 Subject: [PATCH] ci: improve CI workflow for private repository cloning (#241) - Add a new job for git clone and pull in CI - Clone a private repository in CI with secrets - Remove a directory in the cloned repository ref: https://github.com/appleboy/ssh-action/issues/65 --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58d418c..9da0438 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,3 +197,22 @@ jobs: echo "I am $TEST_BAR, thanks" echo "I am $BAR, thanks" echo "I am $TEST_AAA, thanks" + + testing03: + name: git clone and pull + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v1 + + - name: clone private repository + uses: ./ + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script_stop: true + script: | + git clone https://appleboy:${{ secrets.TEST_TOKEN }}@github.com/go-training/self-runner.git test_repository + rm -rf test_repository