From 9b636adbc10c4275bc4cb334a2458b454b7b2ba4 Mon Sep 17 00:00:00 2001 From: Robin Bourianes Date: Fri, 7 Jun 2024 12:23:11 +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 107ecb6..4b3ee66 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,7 +15,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 theme env: diff --git a/scripts/setup_workspace.sh b/scripts/setup_workspace.sh index 71342e8..a6b88e3 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/keycloak-themes.git" "$WORKSPACE_DIR/keycloak-themes" "${WORKSPACE_TAG:-${WORKSPACE_BRANCH:-}}" + git_shallow_clone "$KALISIO_GITHUB_URL/kalisio/keycloak-themes.git" "$WORKSPACE_DIR/keycloak-themes" "${WORKSPACE_TAG:-${WORKSPACE_BRANCH:-}}" fi -setup_workspace "$WORKSPACE_DIR" "$DEVELOPMENT_REPO_URL" +setup_workspace "$WORKSPACE_DIR" "$KALISIO_GITHUB_URL/kalisio/development.git" end_group "Setting up workspace ..."