From 7deb2992e213883e866721d440f6c0429b74f1eb Mon Sep 17 00:00:00 2001 From: Robin Bourianes Date: Fri, 7 Jun 2024 11:41:43 +0200 Subject: [PATCH] ci: now using KALISIO_GITHUB_URL --- .github/workflows/main.yaml | 2 +- scripts/setup_workspace.sh | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cc10749..472106d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,7 +18,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: Build job env: diff --git a/scripts/setup_workspace.sh b/scripts/setup_workspace.sh index 56a71be..d865e06 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,13 +25,12 @@ 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/k-hubeau.git" "$WORKSPACE_DIR/k-hubeau" "${WORKSPACE_TAG:-${WORKSPACE_BRANCH:-}}" + git_shallow_clone "$KALISIO_GITHUB_URL/kalisio/k-hubeau.git" "$WORKSPACE_DIR/k-hubeau" "${WORKSPACE_TAG:-${WORKSPACE_BRANCH:-}}" fi -setup_job_workspace "$WORKSPACE_DIR" "$DEVELOPMENT_REPO_URL" +setup_job_workspace "$WORKSPACE_DIR" "$KALISIO_GITHUB_URL/kalisio/development.git" end_group "Setting up workspace ..."