From d5b219b7b369d2b3a395d80a7694cc91cf1169fc Mon Sep 17 00:00:00 2001 From: Robin Bourianes Date: Fri, 7 Jun 2024 12:02:41 +0200 Subject: [PATCH] ci: now using KALISIO_GITHUB_URL --- .github/workflows/main.yaml | 4 ++-- scripts/setup_workspace.sh | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4f9189c..cf1a314 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,7 +14,7 @@ jobs: run: bash ./scripts/init_runner.sh ${{ github.job }} - name: Setup workspace env: - GITHUB_DEVELOPMENT_TOKEN: ${{ secrets.GH_DEVELOPMENT_TOKEN }} + KALISIO_GITHUB_URL: ${{ secrets.KALISIO_GITHUB_URL }} run: bash ./scripts/setup_workspace.sh - name: Run tests env: @@ -38,7 +38,7 @@ jobs: run: bash ./scripts/init_runner.sh ${{ github.job }} - name: Setup workspace env: - GITHUB_DEVELOPMENT_TOKEN: ${{ secrets.GH_DEVELOPMENT_TOKEN }} + KALISIO_GITHUB_URL: ${{ secrets.KALISIO_GITHUB_URL }} run: bash ./scripts/setup_workspace.sh - name: Run tests env: diff --git a/scripts/setup_workspace.sh b/scripts/setup_workspace.sh index 2ea4038..9652e2b 100755 --- a/scripts/setup_workspace.sh +++ b/scripts/setup_workspace.sh @@ -5,15 +5,13 @@ set -euo pipefail THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}") THIS_DIR=$(dirname "$THIS_FILE") ROOT_DIR=$(dirname "$THIS_DIR") +WORKSPACE_DIR="$(dirname "$ROOT_DIR")" . "$THIS_DIR/kash/kash.sh" begin_group "Setting up workspace ..." -if [ "$CI" = true ]; then - WORKSPACE_DIR="$(dirname "$ROOT_DIR")" - DEVELOPMENT_REPO_URL="https://$GITHUB_DEVELOPMENT_TOKEN@github.com/kalisio/development.git" -else +if [ "$CI" != true ]; then while getopts "b:t" option; do case $option in b) # defines branch @@ -27,12 +25,11 @@ else shift $((OPTIND-1)) WORKSPACE_DIR="$1" - DEVELOPMENT_REPO_URL="$GITHUB_URL/kalisio/development.git" # Clone project in the workspace - git_shallow_clone "$GITHUB_URL/kalisio/feathers-webpush.git" "$WORKSPACE_DIR/feathers-webpush" "${WORKSPACE_TAG:-${WORKSPACE_BRANCH:-}}" + git_shallow_clone "$KALISIO_GITHUB_URL/kalisio/feathers-webpush.git" "$WORKSPACE_DIR/feathers-webpush" "${WORKSPACE_TAG:-${WORKSPACE_BRANCH:-}}" fi -setup_lib_workspace "$WORKSPACE_DIR" "$DEVELOPMENT_REPO_URL" "https://github.com/kalisio/feathers-s3" +setup_lib_workspace "$WORKSPACE_DIR" "$KALISIO_GITHUB_URL/kalisio/development.git" "https://github.com/kalisio/feathers-s3" end_group "Setting up workspace ..."